#!/usr/bin/python2.5
# LEAVE THE FOLLOWING TWO LINES
# GAME BAKER
# yaml
# 0
s = """
!!python/object:game.Game
gameobjects:
  Score: &id003 !!python/object:game.GameObject
    baseworkstate: WSScore
    name: Score
    objtype: Gameobject
    requires: []
    sprite: null
    x: 0
    y: 0
  background: &id006 !!python/object:game.GameObject
    baseworkstate: wsbackground
    name: background
    objtype: Gameobject
    requires: []
    sprite: background
    x: 0
    y: 0
  clock: &id008 !!python/object:game.GameObject
    baseworkstate: wsclock
    name: clock
    objtype: Gameobject
    requires: []
    sprite: null
    x: 0
    y: 40
  cook: &id002 !!python/object:game.GameObject
    baseworkstate: wscook
    name: cook
    objtype: Gameobject
    requires: []
    sprite: gb_cook
    x: 410
    y: 10
  customer: !!python/object:game.GameObject
    baseworkstate: wscustomerstart
    name: customer
    objtype: Gameobject
    requires: []
    sprite: soldier_runright
    x: 0
    y: 0
  dish: !!python/object:game.GameObject
    baseworkstate: wsdish
    name: dish
    objtype: Gameobject
    requires: []
    sprite: drinkcola
    x: 0
    y: 0
  mastercustomer: &id007 !!python/object:game.GameObject
    baseworkstate: wsmastercustomer
    name: mastercustomer
    objtype: Gameobject
    requires: []
    sprite: soldier_runright
    x: 0
    y: 0
  menu: !!python/object:game.GameObject
    baseworkstate: wsmenu
    name: menu
    objtype: Gameobject
    requires: []
    sprite: menu
    x: 0
    y: 0
  menues: &id005 !!python/object:game.GameObject
    baseworkstate: wsmenues
    name: menues
    objtype: Gameobject
    requires: []
    sprite: menues
    x: 5
    y: 80
  menusign: &id004 !!python/object:game.GameObject
    baseworkstate: wsmenusign
    name: menusign
    objtype: Gameobject
    requires: []
    sprite: null
    x: 0
    y: 20
  player: &id001 !!python/object:game.GameObject
    baseworkstate: wsplayerstart
    name: player
    objtype: Gameobject
    requires: []
    sprite: soldier_runright
    x: 200
    y: 350
  playermenu: !!python/object:game.GameObject
    baseworkstate: wsempty
    name: playermenu
    objtype: Gameobject
    requires: []
    sprite: null
    x: 0
    y: 0
  statusline: &id009 !!python/object:game.GameObject
    baseworkstate: wsstatusline
    name: statusline
    objtype: Gameobject
    requires: []
    sprite: null
    x: 0
    y: 580
  table: !!python/object:game.GameObject
    baseworkstate: wstable
    name: table
    objtype: Gameobject
    requires: []
    sprite: table
    x: 0
    y: 0
gamescreens:
  level: !!python/object:game.GameScreen
    color: !!python/tuple [255, 255, 100]
    dimensions: !!python/tuple [1000, 600]
    objtype: Gamescreen
    startobjects:
    - *id001
    - *id002
    - *id003
    - *id004
    - *id005
    - *id006
    - *id007
    - *id008
    - *id009
  levelcomplete: !!python/object:game.GameScreen
    color: !!python/tuple [255, 0, 0]
    dimensions: !!python/tuple [800, 600]
    objtype: Gamescreen
    startobjects: []
initcode: ''
objtype: Game
sprites:
  background: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 255, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [799, 599]
      filename: sprites/images/background.bmp
      topleft: !!python/tuple [0, 0]
    name: background
    objtype: Sprite
  dishempty: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [11, 44]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [0, 38]
    name: dishempty
    objtype: Sprite
  dishschnitzel: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [11, 37]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [0, 30]
    name: dishschnitzel
    objtype: Sprite
  dishspaghetti: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [11, 61]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [0, 54]
    name: dishspaghetti
    objtype: Sprite
  drinkbeer: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [6, 10]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [0, 0]
    name: drinkbeer
    objtype: Sprite
  drinkbeerempty: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [11, 9]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [6, 0]
    name: drinkbeerempty
    objtype: Sprite
  drinkcola: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [5, 19]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [0, 10]
    name: drinkcola
    objtype: Sprite
  drinkmineralwater: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [12, 54]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [7, 45]
    name: drinkmineralwater
    objtype: Sprite
  drinkorange: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [5, 28]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [0, 19]
    name: drinkorange
    objtype: Sprite
  drinkwine: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [11, 29]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [5, 19]
    name: drinkwine
    objtype: Sprite
  drinkwineempty: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [6, 53]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [0, 45]
    name: drinkwineempty
    objtype: Sprite
  flag_sprite: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 1
    imagefiles:
    - bottomright: !!python/tuple [37, 41]
      filename: sprites/images/flag_sprite.bmp
      topleft: !!python/tuple [4, 4]
    - bottomright: !!python/tuple [37, 89]
      filename: sprites/images/flag_sprite.bmp
      topleft: !!python/tuple [4, 52]
    - bottomright: !!python/tuple [37, 137]
      filename: sprites/images/flag_sprite.bmp
      topleft: !!python/tuple [4, 100]
    - bottomright: !!python/tuple [37, 185]
      filename: sprites/images/flag_sprite.bmp
      topleft: !!python/tuple [4, 148]
    - bottomright: !!python/tuple [37, 233]
      filename: sprites/images/flag_sprite.bmp
      topleft: !!python/tuple [4, 196]
    - bottomright: !!python/tuple [37, 281]
      filename: sprites/images/flag_sprite.bmp
      topleft: !!python/tuple [4, 244]
    name: flag_sprite
    objtype: Sprite
  gb_cook: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 255, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [41, 41]
      filename: sprites/images/gb_cook.bmp
      topleft: !!python/tuple [0, 0]
    name: gb_cook
    objtype: Sprite
  gb_cookworking: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 255, 0]
    framerate: 3
    imagefiles:
    - bottomright: !!python/tuple [41, 41]
      filename: sprites/images/gb_cook.bmp
      topleft: !!python/tuple [0, 0]
    - bottomright: !!python/tuple [41, 82]
      filename: sprites/images/gb_cook.bmp
      topleft: !!python/tuple [0, 42]
    - bottomright: !!python/tuple [41, 125]
      filename: sprites/images/gb_cook.bmp
      topleft: !!python/tuple [0, 84]
    - bottomright: !!python/tuple [41, 82]
      filename: sprites/images/gb_cook.bmp
      topleft: !!python/tuple [0, 42]
    name: gb_cookworking
    objtype: Sprite
  ground_sprite: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [1300, 49]
      filename: sprites/images/groundsprite.bmp
      topleft: !!python/tuple [0, 0]
    name: ground_sprite
    objtype: Sprite
  menu: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 255, 255]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [12, 9]
      filename: sprites/images/menu.bmp
      topleft: !!python/tuple [0, 0]
    name: menu
    objtype: Sprite
  menues: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 255, 255]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [12, 15]
      filename: sprites/images/menues.bmp
      topleft: !!python/tuple [0, 0]
    name: menues
    objtype: Sprite
  platform_sprite: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 200
    imagefiles:
    - bottomright: !!python/tuple [400, 20]
      filename: sprites/images/groundsprite.bmp
      topleft: !!python/tuple [100, 5]
    name: platform_sprite
    objtype: Sprite
  red_arrow: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [11, 14]
      filename: sprites/images/red_arrow.bmp
      topleft: !!python/tuple [0, 0]
    name: red_arrow
    objtype: Sprite
  softdrinkempty: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 0, 255]
    framerate: 100
    imagefiles:
    - bottomright: !!python/tuple [10, 18]
      filename: sprites/images/drinksanddishes.bmp
      topleft: !!python/tuple [6, 10]
    name: softdrinkempty
    objtype: Sprite
  soldier_idle: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [39, 50]
      filename: sprites/images/soldier_idle.bmp
      topleft: !!python/tuple [1, 2]
    - bottomright: !!python/tuple [39, 100]
      filename: sprites/images/soldier_idle.bmp
      topleft: !!python/tuple [1, 52]
    - bottomright: !!python/tuple [39, 150]
      filename: sprites/images/soldier_idle.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 200]
      filename: sprites/images/soldier_idle.bmp
      topleft: !!python/tuple [1, 152]
    - bottomright: !!python/tuple [39, 250]
      filename: sprites/images/soldier_idle.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 300]
      filename: sprites/images/soldier_idle.bmp
      topleft: !!python/tuple [1, 252]
    name: soldier_idle
    objtype: Sprite
  soldier_idle_left: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [39, 50]
      filename: sprites/images/soldier_idle_left.bmp
      topleft: !!python/tuple [1, 2]
    - bottomright: !!python/tuple [39, 100]
      filename: sprites/images/soldier_idle_left.bmp
      topleft: !!python/tuple [1, 52]
    - bottomright: !!python/tuple [39, 150]
      filename: sprites/images/soldier_idle_left.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 200]
      filename: sprites/images/soldier_idle_left.bmp
      topleft: !!python/tuple [1, 152]
    - bottomright: !!python/tuple [39, 250]
      filename: sprites/images/soldier_idle_left.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 300]
      filename: sprites/images/soldier_idle_left.bmp
      topleft: !!python/tuple [1, 252]
    name: soldier_idle_left
    objtype: Sprite
  soldier_idle_wobp: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 5
    imagefiles:
    - bottomright: !!python/tuple [39, 50]
      filename: sprites/images/soldier_idle_wobp.bmp
      topleft: !!python/tuple [1, 2]
    - bottomright: !!python/tuple [39, 100]
      filename: sprites/images/soldier_idle_wobp.bmp
      topleft: !!python/tuple [1, 52]
    - bottomright: !!python/tuple [39, 150]
      filename: sprites/images/soldier_idle_wobp.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 200]
      filename: sprites/images/soldier_idle_wobp.bmp
      topleft: !!python/tuple [1, 152]
    - bottomright: !!python/tuple [39, 250]
      filename: sprites/images/soldier_idle_wobp.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 300]
      filename: sprites/images/soldier_idle_wobp.bmp
      topleft: !!python/tuple [1, 252]
    name: soldier_idle_wobp
    objtype: Sprite
  soldier_idle_wobp_left: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 5
    imagefiles:
    - bottomright: !!python/tuple [39, 50]
      filename: sprites/images/soldier_idle_wobp_left.bmp
      topleft: !!python/tuple [1, 2]
    - bottomright: !!python/tuple [39, 100]
      filename: sprites/images/soldier_idle_wobp_left.bmp
      topleft: !!python/tuple [1, 52]
    - bottomright: !!python/tuple [39, 150]
      filename: sprites/images/soldier_idle_wobp_left.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 200]
      filename: sprites/images/soldier_idle_wobp_left.bmp
      topleft: !!python/tuple [1, 152]
    - bottomright: !!python/tuple [39, 250]
      filename: sprites/images/soldier_idle_wobp_left.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 300]
      filename: sprites/images/soldier_idle_wobp_left.bmp
      topleft: !!python/tuple [1, 252]
    name: soldier_idle_wobp_left
    objtype: Sprite
  soldier_runleft: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [39, 48]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 0]
    - bottomright: !!python/tuple [39, 96]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 48]
    - bottomright: !!python/tuple [39, 144]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 96]
    - bottomright: !!python/tuple [39, 192]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 144]
    - bottomright: !!python/tuple [39, 240]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 192]
    - bottomright: !!python/tuple [39, 288]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 240]
    - bottomright: !!python/tuple [39, 336]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 288]
    - bottomright: !!python/tuple [39, 384]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 336]
    - bottomright: !!python/tuple [39, 432]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 384]
    - bottomright: !!python/tuple [39, 480]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 432]
    - bottomright: !!python/tuple [39, 528]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 480]
    - bottomright: !!python/tuple [39, 576]
      filename: sprites/images/soldier_runleft.bmp
      topleft: !!python/tuple [1, 528]
    name: soldier_runleft
    objtype: Sprite
  soldier_runright: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [39, 48]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 0]
    - bottomright: !!python/tuple [39, 96]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 48]
    - bottomright: !!python/tuple [39, 144]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 96]
    - bottomright: !!python/tuple [39, 192]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 144]
    - bottomright: !!python/tuple [39, 240]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 192]
    - bottomright: !!python/tuple [39, 288]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 240]
    - bottomright: !!python/tuple [39, 336]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 288]
    - bottomright: !!python/tuple [39, 384]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 336]
    - bottomright: !!python/tuple [39, 432]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 384]
    - bottomright: !!python/tuple [39, 480]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 432]
    - bottomright: !!python/tuple [39, 528]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 480]
    - bottomright: !!python/tuple [39, 576]
      filename: sprites/images/soldier_runright.bmp
      topleft: !!python/tuple [1, 528]
    name: soldier_runright
    objtype: Sprite
  table: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 255, 255]
    framerate: 1
    imagefiles:
    - bottomright: !!python/tuple [62, 37]
      filename: sprites/images/table.bmp
      topleft: !!python/tuple [0, 0]
    name: table
    objtype: Sprite
  table_4top: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 255, 255]
    framerate: 1
    imagefiles:
    - bottomright: !!python/tuple [62, 56]
      filename: sprites/images/table_4top.bmp
      topleft: !!python/tuple [0, 0]
    name: table_4top
    objtype: Sprite
  table_6top: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 255, 255]
    framerate: 1
    imagefiles:
    - bottomright: !!python/tuple [62, 74]
      filename: sprites/images/table_6top.bmp
      topleft: !!python/tuple [0, 0]
    name: table_6top
    objtype: Sprite
  waiter_idle: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 5
    imagefiles:
    - bottomright: !!python/tuple [39, 50]
      filename: sprites/images/waiter_idle.bmp
      topleft: !!python/tuple [1, 2]
    - bottomright: !!python/tuple [39, 100]
      filename: sprites/images/waiter_idle.bmp
      topleft: !!python/tuple [1, 52]
    - bottomright: !!python/tuple [39, 150]
      filename: sprites/images/waiter_idle.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 200]
      filename: sprites/images/waiter_idle.bmp
      topleft: !!python/tuple [1, 152]
    - bottomright: !!python/tuple [39, 250]
      filename: sprites/images/waiter_idle.bmp
      topleft: !!python/tuple [1, 102]
    - bottomright: !!python/tuple [39, 300]
      filename: sprites/images/waiter_idle.bmp
      topleft: !!python/tuple [1, 252]
    name: waiter_idle
    objtype: Sprite
  waiter_runleft: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [39, 49]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 1]
    - bottomright: !!python/tuple [39, 96]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 48]
    - bottomright: !!python/tuple [39, 144]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 96]
    - bottomright: !!python/tuple [39, 192]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 144]
    - bottomright: !!python/tuple [39, 240]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 192]
    - bottomright: !!python/tuple [39, 288]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 240]
    - bottomright: !!python/tuple [39, 336]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 288]
    - bottomright: !!python/tuple [39, 384]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 336]
    - bottomright: !!python/tuple [39, 432]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 384]
    - bottomright: !!python/tuple [39, 480]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 432]
    - bottomright: !!python/tuple [39, 528]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 480]
    - bottomright: !!python/tuple [39, 576]
      filename: sprites/images/waiter_runleft.bmp
      topleft: !!python/tuple [1, 528]
    name: waiter_runleft
    objtype: Sprite
  waiter_runright: !!python/object:game.Sprite
    alphakey: !!python/tuple [255, 0, 0]
    framerate: 2
    imagefiles:
    - bottomright: !!python/tuple [39, 49]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 1]
    - bottomright: !!python/tuple [39, 96]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 48]
    - bottomright: !!python/tuple [39, 144]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 96]
    - bottomright: !!python/tuple [39, 192]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 144]
    - bottomright: !!python/tuple [39, 240]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 192]
    - bottomright: !!python/tuple [39, 288]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 240]
    - bottomright: !!python/tuple [39, 336]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 288]
    - bottomright: !!python/tuple [39, 384]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 336]
    - bottomright: !!python/tuple [39, 432]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 384]
    - bottomright: !!python/tuple [39, 480]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 432]
    - bottomright: !!python/tuple [39, 528]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 480]
    - bottomright: !!python/tuple [39, 576]
      filename: sprites/images/waiter_runright.bmp
      topleft: !!python/tuple [1, 528]
    name: waiter_runright
    objtype: Sprite
startscreen: level
title: Restaurant - Game Baker Demo
workstates:
  WSScore: !!python/object:game.WorkState
    actions: {1: 'self.z = 100

        self.color = (255,255,255)

        self.resize((100,20))

        self.clear()

        self.old_score = 0

        ', 3: "\\nif game.score <> self.old_score:\\n   self.clear()\\n   self.draw_text(game.score,20,(255,0,0))\\n\\
        \\   self.old_score = game.score\\n"}
    inherits: null
    objtype: Workstate
  wsbackground: !!python/object:game.WorkState
    actions: {1: 'self.z=0

        self.vx=4

        self.vy=0

        self.resize(800,600)

        '}
    inherits: null
    objtype: Workstate
  wsclock: !!python/object:game.WorkState
    actions: {1: 'self.z = 100

        self.hours = 11

        self.minutes = 0

        self.ampm = " a.m."

        self.set_timer(1)

        self.color = (255,255,255)

        self.resize((60,20))

        self.clear()


        ', 11: "self.set_timer(game.gameseconds_per_minute)\\nself.minutes = self.minutes\\
        \\ + 1\\nif self.minutes == 60:\\n   self.minutes = 0\\n   self.hours = self.hours\\
        \\ + 1\\n   if self.hours == 13:\\n      self.hours = 1\\n   if self.hours ==\\
        \\ 12: \\n      if self.ampm == \\" a.m.\\":\\n         self.ampm = \\" p.m.\\"\\n\\
        \\      else:\\n         self.ampm = \\" a.m.\\"\\n   if self.hours == 12 and self.minutes\\
        \\ == 2:\\n      game.save()\\n      \\n\\nself.clear()\\nif self.minutes < 10:\\n\\
        \\   minutestr = \\"0\\" + str(self.minutes)\\nelse:\\n   minutestr = str(self.minutes)\\n\\
        self.draw_text(str(self.hours) + \\":\\" + minutestr + self.ampm,20,(255,0,0))\\n\\
        \\n"}
    inherits: null
    objtype: Workstate
  wscook: !!python/object:game.WorkState
    actions: {1: 'self.vx=0

        self.vy=0

        self.z = 1

        self.resize(41,41)

        self.preparing_order=0

        self.orders = []

        self.dirty_dishes = []

        self.returned_orders = []

        self.preptime=0

        self.minx=460

        self.collision_player = 0

        self.last_order = -1

        ', 3: "if self.collision_player == 1:\\n\\n#cook takes orders from waiter\\n\\n\\
        \\   self.collision_player = 0\\n   orders_taken = 0\\n   ply = gamescreen.gameobjects[\\"\\
        player\\"]\\n   for order in ply.orders:\\n      if order[1] == \\"ordered\\":\\n\\
        \\         order[1] = \\"entered\\"\\n         self.orders.append(order)\\n   \\
        \\      self.sprite = \\"gb_cookworking\\"\\n         orders_taken = orders_taken\\
        \\ + 1\\n\\n   #print \\"Cook:\\"\\n   #print self.orders\\n   ply.orders = []\\n\\
        \\   if orders_taken > 0:\\n      gamescreen.gameobjects[\\"statusline\\"].new_message\\
        \\ = str(orders_taken) + \\" orders given to cook\\"\\n\\n   # for dishes player\\
        \\ is currently carrying, check if the table they belong to still have a customer\\
        \\ that ordered them\\n   \\n   print \\"checking for order validity\\"\\n   for\\
        \\ i in range(0,len(ply.objects)):\\n      order_found = 0\\n      if ply.objects[i].sprite\\
        \\ <> \\"menu\\":\\n         if ply.objects[i].order[1] == \\"carrying\\":\\n   \\
        \\         if ply.objects[i].order[2] == -1:           # object has already\\
        \\ been rendered invalid at table\\n               order_found = 0\\n       \\
        \\     else: \\n               tb = gamescreen.gameobjects[\\"table\\" + str(ply.objects[i].order[2])]\\n\\
        \\               for j in range(0,len(tb.occupants)):\\n                  for\\
        \\ k in range(0,len(tb.occupants[j].orders)):\\n                     if tb.occupants[j].orders[k][0]\\
        \\ == ply.objects[i].order[0]:\\n                        order_found = 1\\n \\
        \\                       break\\n            if order_found == 0:\\n        \\
        \\       temptable = ply.objects[i].order[2]\\n               ply.objects[i].order[1]\\
        \\ = \\"cancelled\\"\\n               self.returned_orders.append(ply.objects[i].order)\\n\\
        \\               ply.objects[i].destroy()\\n               del ply.objects[i]\\n\\
        \\n               # if a dish has been cancelled, check other entered orders\\
        \\ if they belong to the same table and are still valid\\n\\n               if\\
        \\ temptable <> -1:\\n                  for o in range(0,len(self.orders)):\\n\\
        \\                     temporder = self.orders[o]\\n                     order_found\\
        \\ = 0\\n                     if temporder[1] == \\"entered\\":\\n            \\
        \\            tb = gamescreen.gameobjects[\\"table\\" + str(temporder[2])]\\n\\
        \\                        print \\"checking invalid orders\\"\\n             \\
        \\           for j in range(0,len(tb.occupants)):\\n                       \\
        \\    for k in range(0,len(tb.occupants[j].orders)):\\n                    \\
        \\          if tb.occupants[j].orders[k][0] == temporder[0]:\\n            \\
        \\                     order_found = 1\\n                                 break\\n\\
        \\                        if order_found == 0:\\n                          \\
        \\ temporder[1] = \\"cancelled\\"\\n                        print \\"checking invalid\\
        \\ orders complete\\"\\n\\n               # stop going through player objects\\
        \\ because the list has changed\\n               break               \\n    \\
        \\     \\nif self.sprite == \\"gb_cookworking\\":\\n   if self.preptime == 0:\\n\\
        \\n      # get new order to prepare if there are any left\\n\\n      temporder\\
        \\ = [\\"no order\\"]\\n\\n      # first search for order that is the same as the\\
        \\ last one\\n\\n      for i in range(0, len(self.orders)):\\n         temporder\\
        \\ = self.orders[i] \\n         if temporder[1] == \\"entered\\" and temporder[0]\\
        \\ == self.last_order:\\n            temporder[1] = \\"preparing\\"\\n        \\
        \\    break\\n\\n      # next search for drinks\\n\\n      else:\\n         for\\
        \\ i in range(0, len(self.orders)):\\n            temporder = self.orders[i]\\
        \\ \\n            if temporder[1] == \\"entered\\" and game.menu_content[temporder[0]][3]\\
        \\ == \\"drink\\":\\n               temporder[1] = \\"preparing\\"\\n           \\
        \\    break\\n\\n   \\n         # last look for other open orders\\n         else:\\n\\
        \\            for i in range(0, len(self.orders)):\\n               temporder\\
        \\ = self.orders[i] \\n               if temporder[1] == \\"entered\\":\\n    \\
        \\              temporder[1] = \\"preparing\\"\\n                  break\\n\\n \\
        \\     print \\"oders after checking: \\", temporder\\n      if temporder <> [\\"\\
        no order\\"]:\\n         if temporder[1] == \\"preparing\\":\\n            self.prep_order_item\\
        \\ = game.menu_content[temporder[0]]\\n\\n            # search ingredient table\\
        \\ for ingredients for this item\\n            # go through cancelled orders;\\
        \\ if we find one for the same thing, slash ingredient need and preptime\\n\\
        \\ \\n            for j in range(0, len(self.orders)):\\n               temporder2\\
        \\ = self.orders[j]\\n               if temporder[1] == \\"cancelled\\":\\n   \\
        \\               if temporder[0] == temporder2[0]:\\n                     temporder[1]\\
        \\ = \\"used up\\"\\n                     self.preptime = 0.2 * game.frames_per_minute\\
        \\ \\n                     break\\n            \\n            if self.preptime\\
        \\ <= 0:\\n               for j in game.ingredients:\\n\\n                  #\\
        \\ if we found it in that table, go through this list\\n\\n                 \\
        \\ if j[0] == self.prep_order_item[0]:\\n                     for k in j: #\\
        \\ k loops through every needed ingredient for the item we want to prepare\\n\\
        \\                         for l in range(0, len(game.storage)):\\n        \\
        \\                    if game.storage[l][0] == k[0]:\\n                    \\
        \\           game.storage[l][1] = game.storage[l][1] - k[1]\\n             \\
        \\                  game.ingredient_costs = game.ingredient_costs + k[1] *\\
        \\ game.storage[l][2]\\n                               # print \\"ingredient\\
        \\ costs: \\", game.ingredient_costs\\n                               break\\n\\
        \\                     break\\n\\n               self.preptime = self.prep_order_item[2]\\
        \\ * game.frames_per_minute\\n               if temporder[0] == self.last_order:\\n\\
        \\                  self.preptime = self.preptime * 0.5\\n            self.orders[i]\\
        \\ = temporder\\n \\n            # get dishes if there are any to wash\\n\\n  \\
        \\    if self.preptime == 0 and len(self.dirty_dishes) > 0:  # only check this\\
        \\ if no orders were found\\n        self.last_order = -1\\n        dish = self.dirty_dishes[0]\\n\\
        \\        for check_dish in game.dishlist:\\n          if check_dish[1] == dish.sprite:\\n\\
        \\             self.preptime = check_dish[2] * game.frames_per_minute\\n   \\
        \\          print \\"washing\\", check_dish[0]\\n             self.dirty_dishes[0].destroy()\\n\\
        \\             del self.dirty_dishes[0]\\n             break\\n   \\n      if\\
        \\ self.preptime == 0:\\n         self.sprite = \\"gb_cook\\"\\n         self.last_order\\
        \\ = -1\\n      # else:\\n      #    print self.orders\\n   else:\\n      if gamescreen.check_collisions(\\"\\
        player\\",\\"cook\\"):\\n         self.preptime = self.preptime - 2\\n      else:\\n\\
        \\         self.preptime = self.preptime - 1\\n      if self.preptime <= 0:\\n\\
        \\         self.preptime = 0\\n         for i in range(0, len(self.orders)):\\n\\
        \\            temporder = self.orders[i]\\n            if temporder[1] == \\"\\
        preparing\\":\\n               temporder[1] = \\"ready\\"\\n               self.orders[i]\\
        \\ = temporder \\n               self.last_order = temporder[0]\\n          \\
        \\     game.number_dishes = game.number_dishes + 1\\n               min_free_dish\\
        \\ = game.number_dishes\\n               name_order = temporder[0]\\n       \\
        \\        name = \\"dish\\" + str(min_free_dish)\\n               new_dish = gamescreen.add_object(\\"\\
        dish\\", name)\\n \\n               if len(game.shelf) == 0:\\n              \\
        \\    self.minx = 460\\n               new_dish.y = 30\\n               new_dish.x\\
        \\ = (self.minx)\\n               new_dish.z = new_dish.y\\n               new_dish.table\\
        \\ = temporder[2]\\n               new_dish.state = 0\\n               self.minx\\
        \\ = self.minx + 8\\n               new_dish.vx=0\\n               new_dish.vy=0\\n\\
        \\               new_dish.ontable = 0\\n               new_dish.order = temporder\\n\\
        \\               new_dish.order.append(new_dish)\\n               game.shelf.append(new_dish)\\n\\
        \\               gamescreen.gameobjects[\\"statusline\\"].new_message = \\"Cook\\
        \\ finished order for table \\" + str(new_dish.table)\\n\\n               new_dish.sprite\\
        \\ = self.prep_order_item[5]\\n               for spritesize in game.spritesizelist:\\n\\
        \\                   if spritesize[0] == new_dish.sprite:\\n               \\
        \\       new_dish.resize(spritesize[1],spritesize[2])\\n                   \\
        \\   break\\n"}
    inherits: null
    objtype: Workstate
  wscustomerapproach: !!python/object:game.WorkState
    actions: {1: "self.state = 0\\nself.table_found = 0\\n\\n# pre-calculation - this\\
        \\ determines how hungry and thirsty the customer is, and thus, if he will\\
        \\ enter the restaurant\\n\\nif self.number_in_group == 0:\\n   self.hunger =\\
        \\ random.random()\\n   self.thirst = random.random()\\n   self.wage = random.random()\\
        \\ * 20  # determine hourly wage of that customer\\nelse:\\n   self.hunger =\\
        \\ self.first_customer.hunger\\n   self.thirst = self.first_customer.thirst\\n\\
        \\   self.wage = self.first_customer.wage * 0.8 + random.random() * 4  # determine\\
        \\ hourly wage of customer\\n\\nmealvalue = (self.hunger - 0.8) * self.wage *\\
        \\ 10\\ndrinkvalue = (self.thirst - 0.8) * self.wage * 3\\n\\n# calculate value\\
        \\ of this restaurant\\n\\nbest_value = 0 - self.number_in_group * 5\\nbest_meal_value\\
        \\ = 0 - self.number_in_group * 5\\nbest_drink_value = 0 - self.number_in_group\\
        \\ * 5\\n\\nbestvalue_other = 0\\n\\nprint \\"calculating mealvalue...\\"\\n\\nself.chosen_meal\\
        \\ = -1\\nself.chosen_drink = -1\\n\\nif (gamescreen.gameobjects[\\"player\\"].y\\
        \\ > 380) and (gamescreen.gameobjects[\\"player\\"].x > 460) and (gamescreen.gameobjects[\\"\\
        player\\"].x < 540):\\n   less_time = 1\\nelse:\\n   less_time = 0\\n\\nif mealvalue\\
        \\ > 0:\\n   for i in range(0, len(game.menu_content)):\\n      if game.menu_content[i][3]\\
        \\ == \\"meal\\":      \\n         funfactor = 2 + random.random() * 2.01\\n  \\
        \\       tempvalue = (funfactor * self.wage * 0.3) + mealvalue - self.wage\\
        \\ * (1.03 - game.customer_satisfaction / 1.5 - less_time * 0.1) - game.menu_content[i][1]\\n\\
        \\         if tempvalue > best_value:\\n            best_value = tempvalue\\n\\
        \\            self.chosen_meal = i\\n\\n   # Now calculate 5 other restaurants\\
        \\ which may be 0 to 10 minutes away and offer between 1 and 10 dishes\\n\\n\\
        \\   print \\"calculating other restaurants...\\"\\n   for i in range(0,5):\\n\\
        \\      # print \\"iteration 1\\"\\n      distance = random.random()\\n      #\\
        \\ print \\"iteration 2\\"\\n      number_dishes = int(random.random() * 9 + 1)\\n\\
        \\      # print \\"iteration 3\\"\\n      for j in range(0,number_dishes):\\n \\
        \\        # print \\"iteration 4\\"\\n         dishprice = 4.80 + random.random()\\
        \\ * 5.01\\n         # print \\"iteration 5\\"\\n         funfactor = 2 + random.random()\\
        \\ * 2.01\\n         # print \\"iteration 6\\"\\n         tempvalue = (funfactor\\
        \\ * self.wage * 0.3) + mealvalue - self.wage * (0.7 + distance * 0.167)  -\\
        \\ dishprice\\n         # print \\"iteration 7\\"\\n         if tempvalue > bestvalue_other:\\n\\
        \\            # print \\"iteration 8\\"\\n            bestvalue_other = tempvalue\\n\\
        \\nprint \\"Comparing...\\"\\n\\nbest_meal_value = best_value\\nbest_meal_value_competitor\\
        \\ = bestvalue_other\\n\\nprint \\"Mealvalue: \\" + str(mealvalue)\\nprint \\"Best\\
        \\ meal value: \\" + str(best_value)\\n\\nbest_value = 0\\n\\nif drinkvalue < 0:\\n\\
        \\   drinkvalue = 0\\n\\nbestvalue_other = 0\\n\\nprint \\"calculating drinkvalue...\\"\\
        \\n\\nif drinkvalue > 0 or (mealvalue > 0 and random.random() > 0.1):\\n   best_value\\
        \\ = -20\\n   if self.chosen_meal == -1 and self.number_in_group > 0:\\n    \\
        \\  best_value = -200\\n   for i in range(0, len(game.menu_content)):\\n    \\
        \\  if game.menu_content[i][3] == \\"drink\\":      \\n         funfactor = 2\\
        \\ + random.random() * 2.01\\n         if game.menu_content[i][0] == \\"Mineral\\
        \\ water\\":\\n            tempvalue = (funfactor * self.wage * 0.1) + drinkvalue\\
        \\ * 0.6 - self.wage * (0.5 - game.customer_satisfaction / 2- less_time * 0.1)\\
        \\ - game.menu_content[i][1]\\n         elif game.menu_content[i][0] == \\"Beer\\"\\
        :\\n            tempvalue = (funfactor * self.wage * 0.15) + drinkvalue - self.wage\\
        \\ * (0.683 - game.customer_satisfaction / 1.5- less_time * 0.1) - game.menu_content[i][1]\\n\\
        \\         else:\\n            tempvalue = (funfactor * self.wage * 0.1) + drinkvalue\\
        \\ - self.wage * (0.5 - game.customer_satisfaction / 2- less_time * 0.1) -\\
        \\ game.menu_content[i][1]\\n         if tempvalue > best_value:\\n         \\
        \\   best_value = tempvalue\\n            self.chosen_drink = i\\n\\n   print\\
        \\ \\"calculating other restaurants...\\"\\n   for i in range(0,5):\\n      distance\\
        \\ = 0\\n      if mealvalue <= 0:\\n         distance = random.random()\\n   \\
        \\   number_dishes = int(random.random() * 5 + 5)\\n      for j in range(0,number_dishes):\\n\\
        \\         dishprice = 1 + random.random() * 2.01\\n         funfactor = 2 +\\
        \\ random.random() * 2.01\\n         tempvalue = (funfactor * self.wage * 0.1)\\
        \\ + drinkvalue - self.wage * (0.25 + distance * 0.167)  - dishprice\\n    \\
        \\     if tempvalue > bestvalue_other:\\n            bestvalue_other = tempvalue\\n\\
        \\nbest_drink_value = best_value\\nbest_drink_value_competitor = bestvalue_other\\n\\
        \\ncomplete_value = best_meal_value + best_drink_value\\ncomplete_value_competitor\\
        \\ = best_meal_value_competitor + best_drink_value_competitor\\n\\n# if complete_value\\
        \\ is above 0 now, it's worthwile for that customer to visit our restaurant\\n\\
        \\n\\nprint \\"Drinkvalue: \\" + str(drinkvalue)\\nprint \\"Best drink value: \\"\\
        \\ + str(best_value)\\nprint \\"Complete value: \\" + str(complete_value)\\nprint\\
        \\ \\"Complete value of competitor: \\" + str(complete_value_competitor)\\n  \\
        \\        \\n\\nif self.number_in_group == 0 and (complete_value > 0 and complete_value\\
        \\ > complete_value_competitor):\\n   for my_table in [\\"table1\\",\\"table2\\"\\
        ,\\"table3\\",\\"table4\\",\\"table5\\",\\"table6\\",\\"table7\\",\\"table8\\",\\"table9\\"\\
        ]:\\n    tb = gamescreen.gameobjects[my_table]\\n    if tb.occupied == 0 and\\
        \\ tb.size >= self.group_size:\\n        try:\\n           if self.occupied_table.size\\
        \\ > tb.size:\\n              self.occupied_table = tb\\n        except:\\n  \\
        \\         self.occupied_table = tb\\n        self.table_found = 1\\n\\n   if\\
        \\ self.table_found == 0:\\n      self.dly = 100\\n      self.workstate = \\"\\
        wscustomerwait\\"\\n      self.to_enter = 0\\n   else:\\n      self.to_enter =\\
        \\ 1\\n      tb = self.occupied_table\\n      tb.occupants = [self]\\n      tb.occupied\\
        \\ = 1\\nelif self.number_in_group > 0:\\n   self.to_enter = self.first_customer.to_enter\\n\\
        \\   if self.to_enter == 1:\\n      tb = self.first_customer.occupied_table\\n\\
        \\      self.occupied_table = tb\\n      tb.occupants.append(self)\\nelse:\\n\\
        \\   self.to_enter = 0  \\n\\nprint \\"wscustomerapproach: Init ended\\"\\n", 3: "self.z\\
        \\ = self.y+10\\n\\nif self.state == 0:\\n\\n    self.path.new_path(style=\\"linear\\"\\
        )\\n\\n    self.path.add_point(self.x,self.y)\\n    if self.to_enter == 1:\\n\\
        \\       self.path.add_point(450,self.y)\\n       self.path.add_point(470,self.y-10)\\n\\
        \\       self.path.add_point(490,self.y-30)\\n       self.path.add_point(500,self.y-50)\\n\\
        \\       self.path.add_point(500, self.occupied_table.y+92)\\n       self.path.add_point(490,\\
        \\ self.occupied_table.y+72)\\n       self.path.add_point(470, self.occupied_table.y+52)\\n\\
        \\       self.path.add_point(450, self.occupied_table.y+42)\\n       ng = self.number_in_group\\n\\
        \\       if ng == 0 or ng == 2 or ng == 4:\\n          if ng == self.occupied_table.size\\
        \\ - 2:\\n             motx = -10\\n          else:\\n             motx = -35\\n\\
        \\       else:\\n          if ng == self.occupied_table.size - 1:\\n        \\
        \\     motx = 30\\n          else:\\n             motx = 55\\n       if ng ==\\
        \\ 0 or ng == 1:\\n          moty = 0\\n       elif ng == 2 or ng == 3:\\n   \\
        \\       moty = 18\\n       elif ng == 4 or ng == 5:\\n          moty = 36\\n\\n\\
        \\       self.path.add_point(self.occupied_table.x+motx+25,self.occupied_table.y+self.occupied_table.height-15)\\n\\
        \\       self.path.add_point(self.occupied_table.x+motx+15,self.occupied_table.y+self.occupied_table.height-20)\\n\\
        \\       self.path.add_point(self.occupied_table.x+motx+5,self.occupied_table.y+self.occupied_table.height-30)\\n\\
        \\       self.path.add_point(self.occupied_table.x+motx,self.occupied_table.y+self.occupied_table.height-40)\\n\\
        \\       if motx == -10 or motx == 30:\\n          self.path.add_point(self.occupied_table.x+motx,self.occupied_table.y-15+moty)\\n\\
        \\       elif motx == -35:\\n          self.path.add_point(self.occupied_table.x+motx,self.occupied_table.y+10+moty)\\n\\
        \\          self.path.add_point(self.occupied_table.x+motx+5,self.occupied_table.y+moty)\\n\\
        \\          self.path.add_point(self.occupied_table.x+motx+15,self.occupied_table.y-10+moty)\\n\\
        \\          self.path.add_point(self.occupied_table.x+motx+25,self.occupied_table.y-15+moty)\\n\\
        \\       elif motx == 55:\\n          self.path.add_point(self.occupied_table.x+motx,self.occupied_table.y+10+moty)\\n\\
        \\          self.path.add_point(self.occupied_table.x+motx-5,self.occupied_table.y+moty)\\n\\
        \\          self.path.add_point(self.occupied_table.x+motx-15,self.occupied_table.y-10+moty)\\n\\
        \\          self.path.add_point(self.occupied_table.x+motx-25,self.occupied_table.y-15+moty)\\n\\
        \\n    else:\\n       self.path.add_point(1024, self.y)\\n\\n    self.path.set_speed(100)\\n\\
        \\n    self.state = 1\\n\\nelif self.state == 1:\\n    self.oldx = self.x\\n  \\
        \\  self.oldy = self.y\\n    self.path.follow_path(loop=False)\\n\\n    if self.x\\
        \\ < (self.oldx - 1):\\n       self.sprite = \\"soldier_runleft\\"\\n    elif self.x\\
        \\ > (self.oldx + 1):\\n       self.sprite = \\"soldier_runright\\"\\n\\n    if\\
        \\ self.oldx == self.x and self.oldy == self.y:\\n      if self.to_enter ==\\
        \\ 1:\\n         self.workstate = \\"wscustomersitdown\\"\\n      else:\\n     \\
        \\    self.destroy()\\n\\n# elif self.state == 2:\\n#   if self.x < gamescreen.get_object(\\"\\
        table1\\").x + 40:\\n#      self.workstate = \\"wscustomersitdown\\"\\n#      self.state\\
        \\ = 0\\n\\npass"}
    inherits: null
    objtype: Workstate
  wscustomerconsume: !!python/object:game.WorkState
    actions: {1: '# self.dly = 1 + random.random()

        # self.dly = self.dly * 2 * game.frames_per_minute', 3: "self.dly = self.dly\\
        \\ - 1\\n\\n# if costumer has finished consuming everything\\n\\nif self.dly <=\\
        \\ 0:\\n\\n# put each consumed order to the table\\n# and update its status\\n\\n\\
        \\   for i in range(0,len(self.objects)):\\n      o = self.objects[i]\\n    \\
        \\  if o.sprite <> \\"menu\\":\\n         if o.order[1] == \\"consuming\\":\\n  \\
        \\          o.order[1] = \\"owed\\"\\n            print \\"finished order:\\",o.order\\n\\
        \\            # put dish onto table\\n\\n            self.occupied_table.objects.append(o)\\n\\
        \\            o.x = (self.occupied_table.x + self.x) / 2 + 25\\n           \\
        \\ o.y = (self.occupied_table.y + self.y) / 2 +  10\\n\\n            # transform\\
        \\ sprite into empty version\\n\\n            o.sprite = game.menu_content[o.order[0]][4]\\n\\
        \\            print \\"new sprite:\\", o.sprite\\n            for spritesize in\\
        \\ game.spritesizelist:\\n                if spritesize[0] == o.sprite:\\n  \\
        \\                    o.resize(spritesize[1],spritesize[2])\\n             \\
        \\         break\\n\\n            o.state = 3\\n            del self.objects[i]\\n\\
        \\            self.contention = self.contention + 200 * self.group_size_factor\\n\\
        \\            if len(self.objects) == 0:\\n               self.workstate = \\"\\
        wscustomerwaitforwaiter\\"\\n            break"}
    inherits: null
    objtype: Workstate
  wscustomerleave: !!python/object:game.WorkState
    actions: {1: "self.state = 0\\nself.sprite = \\"soldier_runright\\"\\nself.vx = 4\\n\\
        self.vy = 0\\nself.oldx = 0\\nself.oldy = 0\\n\\nself.path.points = [] \\nself.path.new_path(style=\\"\\
        linear\\")\\n\\nself.path.add_point(self.x,self.y)\\n\\nng = self.number_in_group\\n\\
        if ng == 0 or ng == 2 or ng == 4:\\n    if ng == self.occupied_table.size -\\
        \\ 2:\\n       motx = -10\\n    else:\\n       motx = -35\\nelse:\\n    if ng ==\\
        \\ self.occupied_table.size - 1:\\n       motx = 30\\n    else:\\n       motx\\
        \\ = 55\\n\\nif ng == 0 or ng == 1:\\n   moty = 0\\nelif ng == 2 or ng == 3:\\n\\
        \\   moty = 18\\nelif ng == 4 or ng == 5:\\n   moty = 36\\n\\nif motx == -10 or\\
        \\ motx == 30:\\n   pass\\n   # self.path.add_point(self.occupied_table.x+motx,self.occupied_table.y-15+moty)\\n\\
        elif motx == -35:\\n    self.path.add_point(self.occupied_table.x+motx+15,self.occupied_table.y-10+moty)\\n\\
        \\    self.path.add_point(self.occupied_table.x+motx+5,self.occupied_table.y+moty)\\n\\
        \\    self.path.add_point(self.occupied_table.x+motx,self.occupied_table.y+10+moty)\\n\\
        elif motx == 55:\\n    self.path.add_point(self.occupied_table.x+motx-15,self.occupied_table.y-10+moty)\\n\\
        \\    self.path.add_point(self.occupied_table.x+motx-5,self.occupied_table.y+moty)\\n\\
        \\    self.path.add_point(self.occupied_table.x+motx,self.occupied_table.y+10+moty)\\n\\
        \\nself.path.add_point(self.occupied_table.x+motx,self.occupied_table.y+self.occupied_table.height-40)\\n\\
        self.path.add_point(self.occupied_table.x+motx+5,self.occupied_table.y+self.occupied_table.height-30)\\n\\
        self.path.add_point(self.occupied_table.x+motx+15,self.occupied_table.y+self.occupied_table.height-20)\\n\\
        self.path.add_point(self.occupied_table.x+motx+25,self.occupied_table.y+self.occupied_table.height-15)\\n\\
        \\nself.path.add_point(450, self.occupied_table.y+42)\\nself.path.add_point(470,\\
        \\ self.occupied_table.y+52)\\nself.path.add_point(490, self.occupied_table.y+72)\\n\\
        self.path.add_point(500, self.occupied_table.y+92)\\n\\nself.path.add_point(500,476)\\n\\
        self.path.add_point(510,496)\\nself.path.add_point(530,516)\\nself.path.add_point(550,526)\\n\\
        \\nself.path.add_point(1024,526)\\nself.vars[\\"pathpoint\\"] = 0.\\n\\nself.path.set_speed(100)\\n\\
        self.path.start_path()\\n\\nfor i in range(0,len(self.occupied_table.occupants)):\\n\\
        \\   if self.occupied_table.occupants[i] == self:\\n      del self.occupied_table.occupants[i]\\n\\
        \\      break\\n\\nif len(self.occupied_table.occupants) == 0:\\n   self.occupied_table.occupied\\
        \\ = 0\\n", 3: "\\n# self.vars[\\"pathpoint\\"] = (self.vars[\\"pathpoint\\"] + 0.004)\\n\\
        \\n# posn = self.path.get_position(self.vars[\\"pathpoint\\"])\\n\\nself.oldx =\\
        \\ self.x\\nself.oldy = self.y\\nself.path.follow_path(loop=False)\\n\\n# self.x\\
        \\ = posn[0]\\n# self.y = posn[1]\\nself.z = self.y+10\\n\\nif self.x < (self.oldx\\
        \\ - 1):\\n   self.sprite = \\"soldier_runleft\\"\\nelif self.x > (self.oldx +\\
        \\ 1):\\n   self.sprite = \\"soldier_runright\\"\\n\\nif self.x > 1000:\\n   self.destroy()\\n"}
    inherits: null
    objtype: Workstate
  wscustomerorder: !!python/object:game.WorkState
    actions: {1: "# self.number_orders = 1\\n\\n# if customer hasn't had a drink yet,\\
        \\ generate drink order\\n\\n# if self.has_drink == 0:\\n#   temprand = int(random.random()\\
        \\ * len(game.menu_content))\\n\\n# generate order for that drink, state \\"in\\
        \\ customer\\"\\n\\n#   new_order = [temprand,\\"in_customer\\"]\\n\\n# append the\\
        \\ order to the list of customer's orders\\n\\n#   self.orders.append(new_order)\\n\\
        #   print \\"Customer now wants to order: \\", self.orders\\n\\n#   menuitem =\\
        \\ game.menu_content[temprand]\\n\\nnew_message = \\"ordered: \\"\\nfor i in self.orders:\\n\\
        \\   if i[1] == \\"in_customer\\":\\n      new_message = new_message + game.menu_content[i[0]]\\
        \\ [0] + \\" \\"\\n      if game.menu_content[i[0]][3] == \\"meal\\":\\n        self.contention\\
        \\ = self.contention + 7.6 * game.frames_per_minute * self.group_size_factor\\n\\
        if new_message == \\"ordered: \\":\\n   new_message = \\"still waiting for: \\"\\
        \\n   print \\"checking orders of customer\\"\\n   for i in self.orders:\\n   \\
        \\   print i[1]\\n      if i[1] == \\"ordered\\" or i[1] == \\"entered\\" or i[1]\\
        \\ == \\"preparing\\" or i[1] == \\"carrying\\" or i[1] == \\"ready\\":\\n       \\
        \\  new_message = new_message + game.menu_content[i[0]] [0] + \\" \\"\\n\\nif new_message\\
        \\ <> \\"ordered: \\" and new_message <> \\"still waiting for: \\":\\n   gamescreen.gameobjects[\\"\\
        statusline\\"].new_message = new_message\\n\\npass\\n#   self.has_drink = 1",
      3: "for i in range(0,len(self.orders)):\\n   order = self.orders[i] \\n   if order[1]\\
        \\ == \\"in_customer\\":\\n      # game.score = game.score + 1\\n\\n      order[1]\\
        \\ = \\"ordered\\"\\n      ply = gamescreen.gameobjects[\\"player\\"]\\n      ply.orders.append([order[0]\\
        \\ * 1,\\"ordered\\",self.occupied_table.number])\\n      # ply.orders[len(ply.orders)-1].append(\\"\\
        )\\n      # ply.orders[len(ply.orders)-1].append(self.occupied_table.number)\\n\\
        \\      print ply.orders\\n\\n     \\nself.workstate = \\"wscustomerwaitforwaiter\\""}
    inherits: null
    objtype: Workstate
  wscustomerreadmenu: !!python/object:game.WorkState
    actions: {1: 'self.dly = 1 + random.random()

        self.dly = self.dly * 1.6 * game.frames_per_minute', 3: "self.dly = self.dly\\
        \\ - 1\\nif self.dly <= 0:\\n   for i in range(0,len(self.objects)):\\n      if\\
        \\ self.objects[i].sprite == \\"menu\\":\\n         menu = self.objects[i]\\n \\
        \\        menu.x = (self.occupied_table.x + self.x) * 0.5 + 20\\n         menu.y\\
        \\ = (self.occupied_table.y + self.y) * 0.5 + 10\\n         self.has_menu =\\
        \\ 0\\n         self.needs_menu = 0\\n         self.occupied_table.has_menu =\\
        \\ 1\\n         del self.objects[i]\\n         self.occupied_table.objects.append(menu)\\n\\
        \\         gamescreen.gameobjects[\\"statusline\\"].new_message = \\"Customer\\
        \\ finished reading menu\\"\\n\\n         # generate order according to chosen\\
        \\ drink and meal\\n\\n         if self.chosen_drink <> -1:\\n\\n            #\\
        \\ generate order for that drink, state \\"in customer\\"\\n\\n            new_order\\
        \\ = [self.chosen_drink,\\"in_customer\\"]\\n\\n            # append the order\\
        \\ to the list of customer's orders\\n\\n            self.orders.append(new_order)\\n\\
        \\            print \\"Customer now wants to order drink: \\", self.orders\\n\\n\\
        \\         if self.chosen_meal <> -1:\\n\\n            # generate order for that\\
        \\ drink, state \\"in customer\\"\\n\\n            new_order = [self.chosen_meal,\\"\\
        in_customer\\"]\\n\\n            # append the order to the list of customer's\\
        \\ orders\\n\\n            self.orders.append(new_order)\\n            print \\"\\
        Customer now wants to order meal: \\", self.orders\\n  \\n         if len(self.orders)\\
        \\ > 0:\\n            self.workstate = \\"wscustomerwaitforwaiter\\"\\n       \\
        \\  else:\\n            self.workstate = \\"wscustomerleave\\"\\n"}
    inherits: null
    objtype: Workstate
  wscustomersitdown: !!python/object:game.WorkState
    actions: {1: "self.vx = 0\\nself.vy = 0\\nif self.number_in_group == 0 or self.number_in_group\\
        \\ == 2 or self.number_in_group == 4:\\n   self.sprite = \\"soldier_idle_wobp\\"\\
        \\nelse:\\n   self.sprite = \\"soldier_idle_wobp_left\\"\\nself.contention = 20\\
        \\ * game.frames_per_minute\\nif random.random > 0.7:\\n   self.needs_menu =\\
        \\ 1\\nelse:\\n   self.needs_menu = 0\\n\\n# Check if menu is needed and table\\
        \\ contains menu\\nif self.needs_menu == 1:\\n   for i in range(0,len(self.occupied_table.objects)):\\n\\
        \\      object = self.occupied_table.objects[i]\\n      if object.sprite ==\\
        \\ \\"menu\\":\\n         self.workstate = \\"wscustomerreadmenu\\"\\n         self.has_menu\\
        \\ = 1\\n         object.x = self.x + 15\\n         object.y = self.y + 20\\n\\
        \\         object.z = self.z + 20\\n\\n         self.objects.append(object)\\n\\
        \\         del self.occupied_table.objects[i]\\n         # gamescreen.gameobjects[\\"\\
        statusline\\"].new_message = \\"customer took menu from table\\"\\n         break\\n\\
        \\ngamescreen.gameobjects[\\"statusline\\"].new_message = \\"new party arrived\\
        \\ at table \\" + str(self.occupied_table.number)\\n\\nif self.workstate <> \\"\\
        wscustomerreadmenu\\":\\n   self.workstate = \\"wscustomerwaitforwaiter\\"", 3: pass}
    inherits: null
    objtype: Workstate
  wscustomerstart: !!python/object:game.WorkState
    actions: {1: "self.x=-100\\nself.y=530\\nself.z=530\\nself.vx=4\\nself.vy=0\\nself.ax\\
        \\ = 0\\nself.ay = 0\\nself.resize(38,48)\\nself.has_drink = 0\\nself.path.points\\
        \\ = [] \\nself.orders = []\\nself.objects = []\\nself.dly = 1\\nself.needs_menu\\
        \\ = 0\\nself.state = 0\\nprint \\"new customer started\\"\\nself.dist_obst = [1,1]\\n\\
        self.check_dist = 0.5\\nself.path_found = 0\\nself.control_phase = 4\\n", 3: "print\\
        \\ \\"customer iteration\\", self.state\\n\\nif self.state == 0: # state 0 = waiting\\
        \\ for something to happen\\n   self.dly=self.dly - 1\\n\\n   if self.dly <= 0:\\n\\
        \\      self.workstate = \\"wscustomerapproach\\"\\n\\n      # the following code\\
        \\ doesn't get used; it was supposed to be a pathfinding algorithm that goes\\
        \\ around obstructions\\n      # and also other customers, but it turned out\\
        \\ to be too slow.\\n\\n      self.state = 1\\nelif self.state == 1: # state 1\\
        \\ = generate path to the restaurant\\n\\n   self.obstructions = game.obstructions\\n\\
        \\   # self.goal = [500,480]\\n   self.goal = [20,54]\\n   self.goaldescription\\
        \\ = \\"restaurant\\"\\n   self.state = 2\\n   self.vx = 100\\n   self.vy = 0\\n\\
        \\   self.control_phase = -2\\n   self.path_found = 1\\n   game.running_customers.append(self)\\n\\
        \\nelif self.state == 2: # state 2 = run to restaurant (or anywhere)\\n   \\n\\
        \\   # generate line of form y = a1+b1x that's normal to runner's direction\\n\\
        \\n   speed = pow(self.vx * self.vx + self.vy * self.vy, 0.5)\\n\\n# check distance\\
        \\ to goal\\n\\n   distance_goal = pow((self.goal[0] - self.x) * (self.goal[0]\\
        \\ - self.x) + (self.goal[1] - self.y) * (self.goal[1] - self.y),0.5)\\n   print\\
        \\ \\"distance to goal: \\", distance_goal\\n   if distance_goal < 80:\\n     \\
        \\ target_speed = distance_goal + 20\\n      if distance_goal < 10 and self.number_in_group\\
        \\ == 0:\\n         self.workstate = \\"wscustomerapproach\\"\\n   else:\\n    \\
        \\  target_speed = 100\\n   line_x = self.x\\n   line_y = self.y\\n\\n   print\\
        \\ \\"check control phase\\", self.control_phase\\n   if self.control_phase ==\\
        \\ 3:\\n      line_vx = self.vy / speed * target_speed * self.check_dist\\n \\
        \\     line_vy = -self.vx / speed * target_speed * self.check_dist\\n      self.control_phase\\
        \\ = 0\\n   elif self.control_phase == 0:\\n      line_vx = -self.vy / speed\\
        \\ * target_speed * self.check_dist\\n      line_vy = self.vx / speed * target_speed\\
        \\ * self.check_dist\\n      self.control_phase = 1\\n   elif self.control_phase\\
        \\ == 1:\\n      self.control_phase = 2\\n   elif self.control_phase == 2:\\n\\
        \\      self.control_phase = 3\\n \\n   print \\"check obstructions\\"\\n \\n   if\\
        \\ self.control_phase == 0 or self.control_phase == 1:\\n      min_ua = 1000\\n\\
        \\n      for i in self.obstructions:\\n         # print \\"obstruction \\", i\\n\\
        \\         denom = ((game.points[i[1]][1] - game.points[i[0]][1])*(line_vx))\\
        \\ - ((game.points[i[1]][0] - game.points[i[0]][0])*(line_vy))\\n \\n       \\
        \\  nume_a = ((game.points[i[1]][0] - game.points[i[0]][0])*(line_y - game.points[i[0]][1]))\\
        \\ - ((game.points[i[1]][1] - game.points[i[0]][1])*(line_x - game.points[i[0]][0]))\\n\\
        \\n         nume_b = ((line_vx)*(line_y - game.points[i[0]][1])) - ((line_vy)*(line_x\\
        \\ - game.points[i[0]][0]))\\n\\n         coincedent = 0\\n         parallel =\\
        \\ 0\\n\\n         if denom == 0:\\n            if nume_a == 0 and nume_b == 0:\\n\\
        \\               coincedent = 1\\n            else:\\n               parallel\\
        \\ = 1\\n\\n         # print \\"determining ua and ub\\"\\n         if coincedent\\
        \\ == 0 and parallel == 0:\\n            ua = nume_a / denom\\n            ub\\
        \\ = nume_b / denom\\n\\n            if (ua >= 0 and ua < 1 and ub > 0 and ub\\
        \\ < 1):\\n         # Get the intersection point.\\n               intersection_x\\
        \\ = line_x + ua*line_vx\\n               intersection_y = line_y + ua*line_vy\\n\\
        \\               intersecting = 1\\n               if ua < min_ua:\\n       \\
        \\           min_intersection = [intersection_x, intersection_y]\\n        \\
        \\          min_ua = ua\\n            else:\\n               intersecting = 0\\n\\
        \\n   # if character is near the wall, steer him left or right\\n\\n      self.dist_obst[self.control_phase]\\
        \\ = min_ua\\n      if min_ua < 1:\\n         steer_force = 2 / (min_ua + 0.2)\\n\\
        \\         print \\"steer_force / line_vx / line_vy: \\", steer_force, line_vx,\\
        \\ line_vy\\n         # if self.control_phase == 0: # control line to the left\\n\\
        \\         self.vy = self.vy - steer_force * line_vy\\n         self.vx = self.vx\\
        \\ - steer_force * line_vx\\n         # else:\\n         #   self.vy = self.vy\\
        \\ - steer_force * line_vx\\n         #   self.vx = self.vx + steer_force *\\
        \\ line_vy\\n     \\n         print \\"new self.vx / vy: \\", self.vx, self.vy\\n\\
        \\         speed = pow(self.vx * self.vx + self.vy * self.vy, 0.5)\\n      \\
        \\   self.vx = (self.vx * target_speed / speed) / 2 + self.vx / 2\\n       \\
        \\  self.vy = (self.vy * target_speed / speed) / 2 + self.vy / 2\\n   elif self.control_phase\\
        \\ == 2: #phase 2 - steer character towards the goal\\n \\n      if self.dist_obst[0]\\
        \\ < 1 and self.dist_obst[1] < 1:\\n         self.check_dist = self.check_dist\\
        \\ - 0.01\\n         if self.check_dist < ((self.dist_obst[0] + self.dist_obst[1])\\
        \\ / 2):\\n            self.check_dist = ((self.dist_obst[0] + self.dist_obst[1])\\
        \\ / 2)\\n         if self.check_dist < 0.2:\\n            self.check_dist =\\
        \\ 0.2\\n      elif self.check_dist < 1:\\n         self.check_dist = self.check_dist\\
        \\ + 0.01\\n         if self.check_dist > 1:\\n            self.check_dist =\\
        \\ 1\\n      # if not first in the group, change goal to first character in\\
        \\ group\\n\\n      if self.number_in_group > 0:\\n         self.goal = [self.first_customer.x,\\
        \\ self.first_customer.y]\\n         print self.goal\\n      line_vx = self.goal[0]\\
        \\ - self.x\\n      line_vy = self.goal[1] - self.y\\n      print \\"hop 1\\"\\n\\
        \\      tempspeed = pow(line_vx * line_vx + line_vy * line_vy,0.5)\\n      line_vx\\
        \\ = line_vx / tempspeed * 25\\n      line_vy = line_vy / tempspeed * 25\\n \\
        \\     self.vx = self.vx * 0.75 + line_vx\\n      self.vy = self.vy * 0.75 +\\
        \\ line_vy\\n      print \\"hop 2\\"\\n      speed = pow(self.vx * self.vx + self.vy\\
        \\ * self.vy, 0.5)\\n      self.vx = (self.vx * target_speed / speed) / 2 +\\
        \\ self.vx / 2\\n      self.vy = (self.vy * target_speed / speed) / 2 + self.vy\\
        \\ / 2\\n\\n   elif self.control_phase == 3: #phase 3 - steer character away\\
        \\ from other customers\\n      for i in game.running_customers:\\n         if\\
        \\ i <> self:\\n            dist = pow((i.x-self.x) * (i.x-self.x) + (i.y-self.y)\\
        \\ * (i.y-self.y),0.5)\\n            if dist < 60:\\n               dist = ((60\\
        \\ - dist) / 50) * ((60 - dist) / 50) * 100\\n               self.vx = self.vx\\
        \\ - (dist / 50) * (i.x-self.x)\\n               self.vy = self.vy - (dist /\\
        \\ 50) * (i.y-self.y)\\n               speed = pow(self.vx * self.vx + self.vy\\
        \\ * self.vy, 0.5)\\n               self.vx = (self.vx * target_speed / speed)\\
        \\ / 2 + self.vx / 2\\n               self.vy = (self.vy * target_speed / speed)\\
        \\ / 2 + self.vy / 2\\n\\n   elif self.control_phase == 4: #phase 4 - find path\\
        \\ to goal\\n      if self.path_found == 1:\\n         print \\"initializing\\"\\
        \\n         self.path_found = 0\\n         self.mindistance_to_goal = 10000\\n\\
        \\         self.mindist2 = self.mindistance_to_goal * self.mindistance_to_goal\\n\\
        \\         self.pointlist = [[self.x,self.y,-1,0,0]] # format: x, y, state\\
        \\ (examined / to examine), minimum distance, sourcepoint\\n         for i in\\
        \\ game.waypoints:\\n            self.pointlist.append([i[0],i[1],-2,10000,0])\\
        \\ \\n         self.pointlist.append([self.goal[0],self.goal[1],-2,10000,0])\\n\\
        \\         # print \\"initialization complete\\", self.pointlist\\n      else:\\n\\
        \\n         # go through saved list of points and see which points are yet\\
        \\ to be examined as starting point\\n\\n         print \\"go through saved list\\"\\
        \\n         self.path_found = 1\\n         for p in range(0,len(self.pointlist)):\\n\\
        \\            p1 = self.pointlist[p]\\n            if p1[2] == -1:\\n       \\
        \\        # print \\"point\\", p, p1, \\"reaches out to:\\"\\n               p1[2]\\
        \\ = 0\\n               self.path_found = 0\\n               # print \\"iteration\\
        \\ 2\\"\\n               for q in range(0,len(self.pointlist)):\\n           \\
        \\       # print \\"point 2\\", q\\n                  p2 = self.pointlist[q]\\n\\
        \\n                  # first check if the way to the point is longer than the\\
        \\ best found path so far\\n\\n                  if (p2[0]-self.pointlist[0][0])\\
        \\ * (p2[0]-self.pointlist[0][0]) + (p2[1]-self.pointlist[0][1]) * (p2[1]-self.pointlist[0][1])\\
        \\ < self.mindist2:\\n                     check_point = 1\\n               \\
        \\   else:\\n                     check_point = 0\\n\\n                  if check_point\\
        \\ == 1:\\n                     line_x = p1[0]\\n                     line_y\\
        \\ = p1[1]\\n                     line_vx = p2[0]-p1[0]\\n                  \\
        \\   line_vy = p2[1]-p1[1]\\n                     # print \\"checking line\\"\\
        , line_x, line_y, line_vx, line_vy\\n\\n                     intersecting =\\
        \\ 0\\n                     for i in self.obstructions:\\n                  \\
        \\      # print \\"obstruction \\", i, game.points[i[0]], game.points[i[1]]\\n\\
        \\                        denom = ((game.points[i[1]][1] - game.points[i[0]][1])*(line_vx))\\
        \\ - ((game.points[i[1]][0] - game.points[i[0]][0])*(line_vy))\\n \\n       \\
        \\                 nume_a = ((game.points[i[1]][0] - game.points[i[0]][0])*(line_y\\
        \\ - game.points[i[0]][1])) - ((game.points[i[1]][1] - game.points[i[0]][1])*(line_x\\
        \\ - game.points[i[0]][0]))\\n\\n                        nume_b = ((line_vx)*(line_y\\
        \\ - game.points[i[0]][1])) - ((line_vy)*(line_x - game.points[i[0]][0]))\\n\\
        \\n                        coincedent = 0\\n                        parallel\\
        \\ = 0\\n\\n                        if denom == 0:\\n                        \\
        \\   if nume_a == 0 and nume_b == 0:\\n                              coincedent\\
        \\ = 1\\n                           else:\\n                              parallel\\
        \\ = 1\\n\\n                        # print \\"determining ua and ub\\"\\n     \\
        \\                   if coincedent == 0 and parallel == 0:\\n              \\
        \\            ua = nume_a / (denom + 0.0)\\n                          ub = nume_b\\
        \\ / (denom + 0.0)\\n                          # print \\"denom, nume_a, nume_b,\\
        \\ ua, ub:\\",denom,nume_a,nume_b,ua,ub\\n                          if (ua >=\\
        \\ 0 and ua < 1 and ub > 0 and ub < 1):\\n\\n                             # Get\\
        \\ the intersection point.\\n\\n                             intersection_x =\\
        \\ line_x + ua*line_vx\\n                             intersection_y = line_y\\
        \\ + ua*line_vy\\n                             intersecting = 1\\n          \\
        \\                   # print \\"intersecting\\"\\n                          if\\
        \\ intersecting == 1:\\n                             break\\n               \\
        \\      if intersecting == 0:\\n                        # print \\"point\\",q,p2\\n\\
        \\                        if p2[2] == -2:\\n                           p2[2]\\
        \\ = -1\\n                        # print \\"line points\\",p,q\\n            \\
        \\            sumdist = pow((p2[0]-self.pointlist[0][0]) * (p2[0]-self.pointlist[0][0])\\
        \\ + (p2[1]-self.pointlist[0][1]) * (p2[1]-self.pointlist[0][1]),0.5) + p1[3]\\n\\
        \\                        # print \\"sumdist\\",sumdist\\n                   \\
        \\     if sumdist < p2[3]:\\n                           p2[3] = sumdist\\n  \\
        \\                         p2[4] = p\\n                           # print \\"\\
        new point:\\", p2\\n                           if p2[2] == 0:\\n            \\
        \\                  p2[2] = -1\\n                           if q == len(self.pointlist)\\
        \\ - 1:\\n                              if self.mindistance_to_goal > sumdist:\\n\\
        \\                                 self.mindistance_to_goal = sumdist\\n   \\
        \\                              self.mindist2 = self.mindistance_to_goal *\\
        \\ self.mindistance_to_goal\\n                     # if q == 3:\\n          \\
        \\           #   # p2[2.5] = 0\\n\\n         # print \\"point list after iteration:\\"\\
        , self.pointlist\\n         print \\"checking path_found\\"         \\n      \\
        \\   if self.path_found == 1:\\n            current_point = len(self.pointlist)-1\\n\\
        \\            print \\"final waypoint: \\", self.pointlist[len(self.pointlist)-1]\\n\\
        \\            for i in range(0,48):\\n               print \\"i=\\",i\\n      \\
        \\         if self.pointlist[current_point][4] == 0:\\n                  print\\
        \\ \\"heading for point\\", self.pointlist[current_point]\\n                 \\
        \\ self.vx = (self.pointlist[current_point][0] - self.x)\\n                \\
        \\  self.vy = (self.pointlist[current_point][1] - self.y)\\n               \\
        \\   speed = pow(self.vx * self.vx + self.vy * self.vy, 0.5)\\n            \\
        \\      self.vx = (self.vx * target_speed / speed)\\n                  self.vy\\
        \\ = (self.vy * target_speed / speed)\\n                  break\\n          \\
        \\     else:\\n                  print \\"waypoint: \\", self.pointlist[current_point]\\n\\
        \\                  current_point = self.pointlist[current_point][4]\\n    \\
        \\        # p2[2.5] = 0\\n            \\n   self.move_velocity()\\n\\n   print\\
        \\ \\"coordinates: \\", self.x, self.y\\n\\n   # find nearest obstruction to the\\
        \\ left (Phase 0) or right (Phase 1)\\n\\n   \\n# self.workstate = \\"wscustomerapproach\\"\\
        \\n \\n"}
    inherits: null
    objtype: Workstate
  wscustomerwait: !!python/object:game.WorkState
    actions: {1: pass, 3: "\\nself.dly=self.dly - 1\\n\\nif self.dly <= 0:\\n   self.workstate\\
        \\ = \\"wscustomerapproach\\"\\n"}
    inherits: null
    objtype: Workstate
  wscustomerwaitforwaiter: !!python/object:game.WorkState
    actions: {1: "self.message_issued = 0\\nif self.contention > 1000:\\n   if self.number_in_group\\
        \\ == 0 or self.number_in_group == 2 or self.number_in_group == 4:\\n      self.sprite\\
        \\ = \\"soldier_idle_wobp\\"\\n   else:\\n      self.sprite = \\"soldier_idle_wobp_left\\"\\
        \\nelse:\\n   if self.number_in_group == 0 or self.number_in_group == 2 or self.number_in_group\\
        \\ == 4:\\n      self.sprite = \\"soldier_idle\\"\\n   else:\\n      self.sprite\\
        \\ = \\"soldier_idle_left\\"\\n", 3: "self.contention = self.contention - 1\\n\\n\\
        # reset contention to max of all customers on that table if it gets too low\\n\\
        # so that waiter doesn't have to calm customers actually waiting for the other\\
        \\ customers to finish\\n\\nif self.contention <= 1100:\\n   if self.number_in_group\\
        \\ > 0:\\n      for c in self.occupied_table.occupants:\\n         if c.contention\\
        \\ > self.contention:\\n            self.contention = c.contention - 1 \\n\\n\\
        if self.contention <= 1000:   \\n   if self.message_issued == 0:\\n      gamescreen.gameobjects[\\"\\
        statusline\\"].new_message = \\"customer at table\\",self.occupied_table.number,\\"\\
        gets impatient\\"\\n      self.message_issued = 1\\n\\n   if self.number_in_group\\
        \\ == 0 or self.number_in_group == 2 or self.number_in_group == 4:\\n      self.sprite\\
        \\ = \\"soldier_idle\\"\\n   else:\\n      self.sprite = \\"soldier_idle_left\\"\\n\\
        \\nif self.contention <= 0:\\n   gamescreen.gameobjects[\\"statusline\\"].new_message\\
        \\ = \\"customer waited enough... leaving\\"\\n   self.workstate = \\"wscustomerleave\\"\\
        \\n", 5: '# self.workstate = "wscustomerleave"


        print "state of customer:"

        print "orders:", self.orders

        print "has menu: ", self.has_menu

        print "contention: ", self.contention'}
    inherits: null
    objtype: Workstate
  wsdish: !!python/object:game.WorkState
    actions: {1: pass}
    inherits: null
    objtype: Workstate
  wsempty: !!python/object:game.WorkState
    actions: {1: '# This is an empty workstate for all objects that just should be
        displayed, but don''t do anything if not changed by other objects.


        pass'}
    inherits: null
    objtype: Workstate
  wsmastercustomer: !!python/object:game.WorkState
    actions: {1: "game.gameseconds_per_minute = 12\\ngame.frames_per_minute = game.gameseconds_per_minute\\
        \\ * 25\\nself.x = 0\\nself.y = 0\\nself.resize(0,0)\\n\\nself.set_timer(3)\\n\\n\\
        self.number_customers = 0\\ngame.number_tables = 0\\ngame.number_orders = 0\\n\\
        game.number_dishes = 0\\ngame.number_menues = 0\\n\\ngame.case_clear_dishes =\\
        \\ [[\\"plate\\",20],[\\"glass_softdrink\\",10],[\\"glass_beer\\",10],[\\"glass_wine\\"\\
        ,10]]\\n\\ngame.menu_content = [] #this holds the menu content as written in\\
        \\ the restaurant menu\\n#format: 0=name, 1=price, 2=preptime (sec), 3=type,\\
        \\ 4=emptysprite, 5=fullsprite\\n\\ngame.obstructions = []\\ngame.points = []\\n\\
        game.waypoints = []\\n\\ngame.menu_content.append([\\"Coca Cola\\", 1.8, 0.7,\\
        \\ \\"drink\\", \\"softdrinkempty\\", \\"drinkcola\\", 2.15])\\ngame.menu_content.append([\\"\\
        Mineral water\\", 1.0, 0.7, \\"drink\\", \\"softdrinkempty\\", \\"drinkmineralwater\\"\\
        , 2.15])\\ngame.menu_content.append([\\"Beer\\", 2.9, 0.9, \\"drink\\", \\"drinkbeerempty\\"\\
        , \\"drinkbeer\\", 4.3])\\ngame.menu_content.append([\\"Orange juice\\", 1.6, 0.7,\\
        \\ \\"drink\\", \\"softdrinkempty\\", \\"drinkorange\\", 2.15])\\ngame.menu_content.append([\\"\\
        Wine\\", 2.2, 0.7, \\"drink\\", \\"drinkwineempty\\", \\"drinkwine\\", 2.15])\\ngame.menu_content.append([\\"\\
        Wiener Schnitzel\\", 5.2, 5, \\"meal\\", \\"dishempty\\", \\"dishschnitzel\\", 19.5])\\n\\
        game.menu_content.append([\\"Fish & Chips\\", 5.2, 5, \\"meal\\", \\"dishempty\\"\\
        , \\"dishschnitzel\\", 19.5])\\ngame.menu_content.append([\\"Spaghetti Bolognese\\"\\
        , 4.4, 4.2, \\"meal\\", \\"dishempty\\", \\"dishspaghetti\\", 19.5])\\n\\n#format:\\
        \\ 0=name, 1=width, 2=height\\ngame.spritesizelist = [[\\"softdrinkempty\\",5,10],[\\"\\
        drinkmineralwater\\",5,10],[\\"drinkorange\\",5,10],[\\"drinkcola\\",5,10]]\\ngame.spritesizelist.append([\\"\\
        drinkbeerempty\\",6,12])\\ngame.spritesizelist.append([\\"drinkbeer\\",6,11])\\n\\
        game.spritesizelist.append([\\"drinkwineempty\\",6,9])\\ngame.spritesizelist.append([\\"\\
        drinkwine\\",6,11])\\ngame.spritesizelist.append([\\"dishempty\\",11,7])\\ngame.spritesizelist.append([\\"\\
        dishschnitzel\\",11,7])\\ngame.spritesizelist.append([\\"dishspaghetti\\",11,7])\\n\\
        \\ngame.ingredients = []\\n#format: [name, [name of ingredient, amount of ingredient]...]\\n\\
        game.ingredients.append([\\"Coca Cola\\", [\\"Coca Cola\\",0.25],[\\"glass_softdrink\\"\\
        ,1],[\\"Cook\\",0.7]])\\ngame.ingredients.append([\\"Mineral water\\", [\\"Mineral\\
        \\ water\\",0.25],[\\"glass_softdrink\\",1],[\\"Cook\\",0.7]])\\ngame.ingredients.append([\\"\\
        Beer\\", [\\"Beer\\",0.5],[\\"glass_beer\\",1],[\\"Cook\\",0.9]])\\ngame.ingredients.append([\\"\\
        Orange juice\\", [\\"Orange juice\\",0.25],[\\"glass_softdrink\\",1],[\\"Cook\\"\\
        ,0.7]])\\ngame.ingredients.append([\\"Wine\\", [\\"Wine\\",0.25],[\\"glass_wine\\"\\
        ,1],[\\"Cook\\",0.75]])\\ngame.ingredients.append([\\"Wiener Schnitzel\\", [\\"\\
        Baked Schnitzel\\",0.16],[\\"Potato salad\\",0.125],[\\"Cook\\",5.0]])\\ngame.ingredients.append([\\"\\
        Fish & Chips\\", [\\"Baked Fish\\",0.15],[\\"Pommes Frites\\",0.125],[\\"Cook\\"\\
        ,5.0]])\\ngame.ingredients.append([\\"Spaghetti Bolognese\\", [\\"Noodles\\",0.15],[\\"\\
        Sauce Bolognese\\",0.125],[\\"Cook\\",5.0]])\\n\\ngame.dishlist = []\\n#format:\\
        \\ [name of dish, name of sprite (empty dish), time to wash (in minutes)]\\n\\
        game.dishlist.append([\\"glass_softdrink\\",\\"softdrinkempty\\",0.5])\\ngame.dishlist.append([\\"\\
        glass_beer\\",\\"drinkbeerempty\\",0.6])\\ngame.dishlist.append([\\"glass_wine\\"\\
        ,\\"drinkwineempty\\",0.5])\\ngame.dishlist.append([\\"plate\\",\\"dishempty\\",1.0])\\n\\
        \\n\\ngame.storage = [] # list of ingredients in storage, along with amount\\n\\
        #format: [name of ingredient, amount of ingredient stored, value of each unit\\
        \\ of ingredient]\\ngame.storage.append([\\"Coca Cola\\",12.0,0.79])\\ngame.storage.append([\\"\\
        Mineral water\\",12.0,0.36])\\ngame.storage.append([\\"Beer\\",10.0,1.12])\\ngame.storage.append([\\"\\
        Orange juice\\",12.0,0.65])\\ngame.storage.append([\\"Wine\\",2.0,2.5])\\ngame.storage.append([\\"\\
        Baked Schnitzel\\",6.4,5.39])\\ngame.storage.append([\\"Potato salad\\",10.0,1.58])\\n\\
        game.storage.append([\\"Baked Fish\\",7.5,5.5])\\ngame.storage.append([\\"Pommes\\
        \\ Frites\\",12.5,0.89])\\ngame.storage.append([\\"Noodles\\",10.0,1.58])\\ngame.storage.append([\\"\\
        Sauce Bolognese\\",7.5,4.00])\\ngame.shelf = [] # list of dishes and drinks\\
        \\ ready for taking by the waiter\\ngame.storage_startofday = game.storage\\n\\
        \\n# create 3 x 3 tables\\nfor game.number_tables in range(1,10):\\n   name =\\
        \\ \\"table\\" + str(game.number_tables)\\n   a = gamescreen.add_object(\\"table\\"\\
        , name)\\n\\n   if game.number_tables < 4: \\n      a.x = 100\\n      a.y = (game.number_tables)\\
        \\ * 100 \\n   elif game.number_tables < 7:\\n      a.x = 210\\n      a.y = (game.number_tables-3)\\
        \\ * 100\\n   else:\\n      a.x = 320\\n      a.y = (game.number_tables-6) * 100\\n\\
        \\   a.z = a.y\\n   if name == \\"table4\\" or name == \\"table7\\" or name == \\"\\
        table8\\":\\n      a.sprite = \\"table_6top\\"\\n      a.resize(62,74)\\n      a.height\\
        \\ = 74\\n      a.size = 6\\n   elif name == \\"table1\\" or name == \\"table5\\"\\
        \\ or name == \\"table9\\":\\n      a.sprite = \\"table_4top\\"\\n      a.resize(62,56)\\n\\
        \\      a.height = 56\\n      a.size = 4\\n   else:\\n      a.resize(62,36)\\n\\
        \\      a.height = 36\\n      a.size = 2\\n   a.vx=0\\n   a.vy=0\\n   a.occupied=0\\n\\
        \\   a.has_menu = 0\\n   a.number = game.number_tables\\n\\n   game.points.append([a.x,a.y])\\n\\
        \\   game.points.append([a.x,a.y+a.height])\\n   game.points.append([a.x+62,a.y])\\n\\
        \\   game.points.append([a.x+62,a.y+a.height])\\n\\n   game.waypoints.append([a.x-10,a.y-10])\\n\\
        \\   game.waypoints.append([a.x-10,a.y+a.height+10])\\n   game.waypoints.append([a.x+72,a.y-10])\\n\\
        \\   game.waypoints.append([a.x+72,a.y+a.height+10])\\n\\n   pointnr = len(game.points)\\n\\
        \\   game.obstructions.append([pointnr-3,pointnr-2])\\n   game.obstructions.append([pointnr-2,pointnr])\\n\\
        \\   game.obstructions.append([pointnr,pointnr-1])\\n   game.obstructions.append([pointnr-1,pointnr-3])\\n\\
        \\n   gamescreen.vars.setdefault(\\"tables\\",[]).append(name)\\n\\n# add obstructions\\
        \\ for walls\\n\\ngame.points.append([0,34]) #upper left edge of restaurant\\n\\
        game.points.append([0,430]) #lower left edge of restaurant\\ngame.points.append([494,430])\\
        \\ #upper left corner of door\\ngame.points.append([495,475]) #lower left corner\\
        \\ of door\\ngame.points.append([-500,475]) #upper left corner of outside area\\n\\
        game.points.append([-500,560]) #lower left corner of outside area\\ngame.points.append([800,560])\\
        \\ #lower right corner of outside area\\ngame.points.append([800,475]) #upper\\
        \\ right corner of outside area\\ngame.points.append([538,475]) #lower right\\
        \\ corner of door\\ngame.points.append([538,430]) #upper right corner of door\\n\\
        game.points.append([800,430]) #lower right corner of restaurant\\ngame.points.append([800,34])\\
        \\ # upper right corner of restaurant\\n\\ngame.waypoints.append([10,44]) #upper\\
        \\ left edge of restaurant\\ngame.waypoints.append([10,420]) #lower left edge\\
        \\ of restaurant\\ngame.waypoints.append([504,420]) #upper left corner of door\\n\\
        game.waypoints.append([504,485]) #lower left corner of door\\ngame.waypoints.append([-490,485])\\
        \\ #upper left corner of outside area\\ngame.waypoints.append([-490,540]) #lower\\
        \\ left corner of outside area\\ngame.waypoints.append([790,540]) #lower right\\
        \\ corner of outside area\\ngame.waypoints.append([790,485]) #upper right corner\\
        \\ of outside area\\ngame.waypoints.append([548,485]) #lower right corner of\\
        \\ door\\ngame.waypoints.append([548,420]) #upper right corner of door\\ngame.waypoints.append([790,420])\\
        \\ #lower right corner of restaurant\\ngame.waypoints.append([790,34]) # upper\\
        \\ right corner of restaurant\\n\\nfor i in range(len(game.points)-12,len(game.points)-1):\\n\\
        \\  game.obstructions.append([i,i+1])\\ngame.obstructions.append([len(game.points)-12,len(game.points)-1])\\n\\
        \\ngame.running_customers = []", 3: pass, 11: "# Create a new customer\\n# (modeled\\
        \\ after the alien creation logic in space aliens demo)\\n\\nprint \\"timer event\\
        \\ fired\\"\\n\\n# determine if we create a group of 1 or 2 customers\\n\\ngroup_size\\
        \\ = random.choice([1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,6])\\n\\
        \\ngroupsize_factor = [1.0,1.5,1.75,1.9,2.0,2.1][group_size-1]\\n\\nprint \\"\\
        group size:\\", group_size\\nfor i in range(0,group_size):\\n   self.number_customers\\
        \\ = self.number_customers + 1\\n   name = \\"customer\\" + str(self.number_customers)\\n\\
        \\   a = gamescreen.add_object(\\"customer\\", name)\\n   a.x = a.x - i * 40\\n\\
        \\   a.dly = a.dly + i\\n   a.number_in_group = i\\n   a.group_size = group_size\\n\\
        \\   a.group_size_factor = groupsize_factor\\n   a.contention = 200\\n   if i\\
        \\ == 0:\\n      first_customer = a\\n   else:\\n      a.first_customer = first_customer\\n\\
        \\ngamescreen.vars.setdefault(\\"customers\\",[]).append(name)\\n\\ncl = gamescreen.gameobjects[\\"\\
        clock\\"]\\nprint \\"cl.hours:\\",cl.hours\\nprint \\"gameseconds_per_minute:\\"\\
        ,game.gameseconds_per_minute\\nif cl.hours < 12:\\n   new_timer = (130 - ((cl.hours\\
        \\ + cl.minutes * 0.0167) * 10)) * 0.083 * game.gameseconds_per_minute\\nelse:\\n\\
        \\   new_timer = ((cl.hours + cl.minutes * 0.0167) - 11) * 0.83 * game.gameseconds_per_minute\\n\\
        \\nprint \\"new timer:\\", new_timer\\nself.set_timer(new_timer)"}
    inherits: null
    objtype: Workstate
  wsmenu: !!python/object:game.WorkState
    actions: {1: 'self.vx=0

        self.vy=0

        self.occupied=0'}
    inherits: null
    objtype: Workstate
  wsmenues: !!python/object:game.WorkState
    actions: {1: 'self.z=321

        self.vx=0

        self.vy=0

        self.resize(11,14)


        '}
    inherits: null
    objtype: Workstate
  wsmenusign: !!python/object:game.WorkState
    actions: {1: 'self.color = (255,255,255)

        self.clear()

        self.resize(400,25)

        self.z = 40

        # self.draw_text("Today''s special: Wiener Schnitzel with potato salad $ 7.10",20)

        '}
    inherits: null
    objtype: Workstate
  wsplayercelebrate: !!python/object:game.WorkState
    actions: {1: '

        self.sprite = "soldier_applaud"

        self.vx = 0

        self.vy = 0

        self.count = 0

        ', 3: "\\nself.count +=1\\nif self.count > 40:\\n    game.change_game_screen(\\"\\
        levelcomplete\\")\\npass"}
    inherits: null
    objtype: Workstate
  wsplayerclose: !!python/object:game.WorkState
    actions: {1: "# This workstate gets invoked when player closes the restaurant\\n\\
        \\n# it displays some satistics across the screen\\n\\nself.final_messages =\\
        \\ []\\nmessage = \\"Restaurant closed for today\\"\\nself.final_messages.append(message)\\n\\
        message = \\"Money earned: \\" + str(game.score)\\nself.final_messages.append(message)\\n\\
        message = \\"Expenses: \\"\\ntax_drinks = 0\\ntax_dishes = 0\\nprint \\"Closing\\
        \\ restaurant... Fulfilled orders:\\"\\n# for o in self.orders:\\n#   print o[1]\\n\\
        #   if o[1] == \\"paid\\":\\n#      print game.menu_content[o[0]][3]\\n#     \\
        \\ if game.menu_content[o[0]][3] == \\"drink\\":\\n#         tax_drinks = tax_drinks\\
        \\ + game.menu_content[o[0]][1]\\n#      else:\\n#         tax_dishes = tax_dishes\\
        \\ + game.menu_content[o[0]][1]\\n#tax_drinks = tax_drinks / 6\\n#tax_dishes\\
        \\ = tax_dishes / 11\\nmessage = \\"tax on drinks: \\" + str(game.tax_drinks)\\n\\
        self.final_messages.append(message)\\nmessage = \\"tax on dishes: \\" + str(game.tax_dishes)\\n\\
        self.final_messages.append(message)\\n#ingredient_costs = 0\\n#print \\"Closing\\
        \\ restaurant... Ingredient costs:\\"\\n#for i in range(0,len(game.storage)):\\n\\
        #   print game.storage_startofday[i][1], game.storage[i][1]\\n#   ingredient_costs\\
        \\ = ingredient_costs + (game.storage_startofday[i][1]*game.storage_startofday[i][2])\\
        \\ - (game.storage[i][1]*game.storage[i][2])\\nmessage = \\"cost of ingredients:\\
        \\ \\" + str(game.ingredient_costs)\\nself.final_messages.append(message)\\nck\\
        \\ = gamescreen.gameobjects[\\"clock\\"]\\nclock_final = (ck.hours - 11) * 60\\
        \\ + ck.minutes\\nif clock_final < 0:\\n   clock_final = clock_final + 720\\n\\
        cook_salary = clock_final * 0.25\\nmessage = \\"salary of cook: \\" + str(cook_salary)\\n\\
        self.final_messages.append(message)\\nmessage = \\"costs of rent and utility\\
        \\ services: 16\\"\\nself.final_messages.append(message)\\ngain = game.score -\\
        \\ game.tax_dishes - game.tax_drinks - game.ingredient_costs - cook_salary\\
        \\ - 16\\nmessage = \\"final gain / loss: \\"  + str(gain)\\nself.final_messages.append(message)\\n\\
        salary_per_hour = gain / (clock_final * 0.016667)\\nmessage = \\"Your salary\\
        \\ per hour: \\"  + str(salary_per_hour)\\nself.final_messages.append(message)\\n\\
        message = \\"Final customer satisfaction: \\"  + str(int(game.customer_satisfaction\\
        \\ * 10000)*0.01) + \\"%\\"\\nself.final_messages.append(message)\\n\\nfor i in\\
        \\ range(0,len(self.final_messages)):\\n   name = \\"finalmessage\\" + str(i)\\n\\
        \\   a = gamescreen.add_object(\\"playermenu\\", name)\\n   a.x = 50\\n   a.y =\\
        \\ 100 + i * 20\\n   a.z = 1003\\n   a.resize(600,20)\\n   a.color = (0,0,0)\\n\\
        \\   a.clear()\\n   a.draw_text(self.final_messages[i],20,(255,255,255))\\n"}
    inherits: null
    objtype: Workstate
  wsplayermenu: !!python/object:game.WorkState
    actions: {1: 'pass


        # initialize the menu structure to the top level


        self.menu_structure = ["View menu", "View storage", "Order ingredients", "Offer
        special", "Retract special", "Place ad", "Close restaurant", "Exit"]


        self.current_menu_item = 0

        self.previous_menu_item = 0


        self.menu_changed = 1

        self.menu_level = 1

        self.submenu = 1

        self.previous_menu_level = 0

        ', 3: "\\nif self.menu_changed == 1:\\n   if self.menu_level > self.previous_menu_level\\
        \\ or self.menu_level < self.previous_menu_level:\\n      print \\"building menu\\"\\
        \\n      for i in range(0,len(self.menu_structure)):\\n         name = \\"playermenu_\\"\\
        \\ + str(self.menu_level) + \\"_\\" + str(i)\\n         a = gamescreen.add_object(\\"\\
        playermenu\\", name)\\n         a.x = 500 + self.menu_level * 20\\n         a.y\\
        \\ = 50 + i * 20\\n         a.z = 1000 + self.menu_level\\n         a.resize(200,20)\\n\\
        \\         if self.menu_level == 1:\\n            a.color = (255,255,255)\\n\\
        \\         else:\\n            a.color = (255,255,0)\\n         a.clear()\\n \\
        \\        if self.current_menu_item == i:\\n            a.draw_text(self.menu_structure[i],20,(255,0,0))\\n\\
        \\         else:\\n            a.draw_text(self.menu_structure[i],20,(0,0,255))\\n\\
        \\n      self.previous_menu_level = self.menu_level\\n\\n   if self.current_menu_item\\
        \\ <> self.previous_menu_item:\\n      a = gamescreen.gameobjects[\\"playermenu_\\"\\
        \\ + str(self.menu_level) + \\"_\\" + str(self.previous_menu_item)]\\n      a.clear()\\n\\
        \\      a.draw_text(self.menu_structure[self.previous_menu_item],20,(0,0,255))\\n\\
        \\      a = gamescreen.gameobjects[\\"playermenu_\\" + str(self.menu_level) +\\
        \\ \\"_\\" + str(self.current_menu_item)]    \\n      a.clear()\\n      a.draw_text(self.menu_structure[self.current_menu_item],20,(255,0,0))\\n\\
        \\      self.previous_menu_item = self.current_menu_item\\n", 546: "if self.current_menu_item\\
        \\ > 0:\\n   self.current_menu_item = self.current_menu_item - 1\\n   self.menu_changed\\
        \\ = 1\\n\\n", 548: "if self.current_menu_item < (len(self.menu_structure) -\\
        \\ 1):\\n   self.current_menu_item = self.current_menu_item + 1\\n   self.menu_changed\\
        \\ = 1\\n\\n", 550: "if self.menu_structure[self.current_menu_item] == \\"View\\
        \\ menu\\":\\n   self.menu_level = 2\\n   self.submenu = 2\\n   self.current_menu_item\\
        \\ = 0\\n   self.menu_structure = []\\n   for i in game.menu_content:\\n     \\
        \\ self.menu_structure.append(i[0] + \\" $ \\" + str(i[1]))\\n\\n   self.menu_structure.append(\\"\\
        Back\\")\\n   self.menu_changed = 1\\n\\nelif self.menu_structure[self.current_menu_item]\\
        \\ == \\"View storage\\":\\n   self.menu_level = 2\\n   self.submenu = 3\\n   self.current_menu_item\\
        \\ = 0\\n   self.menu_structure = []\\n   for i in game.storage:\\n      self.menu_structure.append(str(i[1])\\
        \\ + \\" l \\" + str(i[0]))\\n\\n   self.menu_structure.append(\\"Back\\")\\n   self.menu_changed\\
        \\ = 1\\n\\nelif self.menu_structure[self.current_menu_item] == \\"Close restaurant\\"\\
        :\\n   self.workstate = \\"wsplayerclose\\"\\n\\nprint self.menu_level, self.submenu,\\
        \\ self.menu_structure[self.current_menu_item]\\nif self.menu_level == 2 and\\
        \\ self.submenu == 2 and self.menu_structure[self.current_menu_item] <> \\"\\
        Back\\":\\n   i = game.menu_content[self.current_menu_item]\\n   i[1] = i[1]\\
        \\ + 0.1\\n   \\n   self.menu_structure[self.current_menu_item] = i[0] + \\" $\\
        \\ \\" + str(i[1])\\n   game.menu_content[self.current_menu_item] = i\\n   self.previous_menu_item\\
        \\ = self.previous_menu_item + 1\\n   self.menu_changed = 1", 552: "# Exit menu\\
        \\ system\\n\\nif self.menu_structure[self.current_menu_item] == \\"Exit\\":\\n\\
        \\   for i in range(0,len(self.menu_structure)):\\n      a = gamescreen.gameobjects[\\"\\
        playermenu_1_\\" + str(i)]\\n      a.destroy()\\n  \\n   self.y = self.y + 20\\n\\
        \\   self.workstate = \\"wsplayerstart\\" \\n\\n# Return to previous menu level\\n\\
        \\nif self.menu_structure[self.current_menu_item] == \\"Back\\":\\n   for i in\\
        \\ range(0,len(self.menu_structure)):\\n      a = gamescreen.gameobjects[\\"\\
        playermenu_\\" + str(self.menu_level) + \\"_\\" + str(i)]\\n      a.destroy()\\n\\
        \\  \\n   self.menu_level = self.menu_level - 1\\n   self.current_menu_item =\\
        \\ 0\\n   self.previous_menu_item = 0\\n\\n   if self.menu_level == 1:\\n     \\
        \\ self.menu_structure = [\\"View menu\\", \\"View storage\\", \\"Order ingredients\\"\\
        , \\"Offer special\\", \\"Retract special\\", \\"Place ad\\", \\"Close restaurant\\"\\
        , \\"Exit\\"]\\n\\n   self.menu_changed = 1\\n\\n# Decrease price of a menu item\\n\\
        \\nif self.menu_level == 2 and self.submenu == 2 and self.menu_structure[self.current_menu_item]\\
        \\ <> \\"Back\\":\\n   if game.menu_content[self.current_menu_item][1] > 0.1:\\n\\
        \\      i = game.menu_content[self.current_menu_item]\\n      i[1] = i[1] -\\
        \\ 0.1\\n   \\n      self.menu_structure[self.current_menu_item] = i[0] + \\"\\
        \\ $ \\" + str(i[1])\\n      game.menu_content[self.current_menu_item] = i\\n\\
        \\      self.previous_menu_item = self.previous_menu_item + 1\\n      self.menu_changed\\
        \\ = 1\\n"}
    inherits: null
    objtype: Workstate
  wsplayerstart: !!python/object:game.WorkState
    actions: {-552: self.vx = 0, -550: 'self.vx = 0

        ', -548: self.vy = 0, -546: self.vy = 0, 1: "\\ngamescreen.color=[140,140,100]\\n\\
        \\nself.vx=0\\nself.vy=0\\nself.ax=0\\nself.ay=0\\n\\n# initialize only if accessing\\
        \\ an attribute of the player fails\\n\\ntry:\\n   test = self.menu_structure\\n\\
        except:\\n   game.customer_satisfaction = 0.5\\n   game.ingredient_costs = 0\\n\\
        \\   game.tax_drinks = 0\\n   game.tax_dishes = 0\\n   self.resize(38,48)\\n \\
        \\  self.number_orders = 0\\n   self.number_full_dishes = 0\\n   self.number_empty_dishes\\
        \\ = 0\\n   self.has_menu = 0\\n   self.previous_collision = 0\\n   self.displacement_object\\
        \\ = 5\\n   self.orders = []\\n   self.objects = []\\n   self.menu_structure =\\
        \\  []\\n\\n# Note: objects only lists the visible objects the player carries;\\n\\
        # orders the player \\"carries\\" are invisible and thus not listed here.\\n\\n\\
        # Move the game screen\\n\\n   gamescreen.move_gamescreen([0,0],gradual=True,acceleration=1)\\n",
      3: "# A few comments won't hurt!\\n\\n# Check if the player is on any surface\\
        \\ (table, that is)\\n\\nself.onsurface=False\\n\\nself.vytemp = self.vy\\nself.vxtemp\\
        \\ = self.vx\\n\\n# Check if the player is at the table with the menus\\n\\nif\\
        \\ gamescreen.check_collisions(\\"player\\",\\"menues\\"):\\n   if self.previous_collision\\
        \\ == 0:\\n      self.previous_collision = 1\\n      print \\"player collides\\
        \\ with menu table\\"\\n\\n      # lay down any menues player has on menu table\\n\\
        \\n      self.has_menu = 0\\n      for i in range(0,len(self.objects)):\\n  \\
        \\        o = self.objects[i]\\n          if o.sprite == \\"menu\\":         \\
        \\   \\n             print \\"laying down menu\\", i                         \\
        \\    \\n             gamescreen.gameobjects[\\"statusline\\"].new_message = \\"\\
        laid down 1 menu\\"\\n             o.destroy()\\n             del self.objects[i]\\n\\
        \\             self.has_menu = self.has_menu + 1\\n             print \\"finished\\
        \\ laying down menu\\"\\n             break\\n\\n      # pick up menues if the\\
        \\ player previously didn't have any\\n      # count how many menues we need\\n\\
        \\n\\n      if self.has_menu == 0:\\n         menues_needed = 0\\n         for\\
        \\ name in [\\"table1\\",\\"table2\\",\\"table3\\",\\"table4\\",\\"table5\\",\\"table6\\"\\
        ,\\"table7\\",\\"table8\\",\\"table9\\"]:\\n            tb = gamescreen.gameobjects[name]\\n\\
        \\            for c in tb.occupants:\\n               if c.needs_menu == 1 and\\
        \\ (c.workstate == \\"wscustomerwaitforwaiter\\" or c.workstate == \\"wscustomerapproach\\"\\
        ):\\n                  menues_needed = menues_needed + 1\\n         if menues_needed\\
        \\ == 0:\\n            menues_needed = 1\\n\\n         print \\"player has no menu\\"\\
        \\n         self.has_menu = 1\\n         for i in range(0,menues_needed):\\n\\
        \\             game.number_menues = game.number_menues + 1\\n             name\\
        \\ = \\"menu\\" + str(game.number_menues)\\n             a = gamescreen.add_object(\\"\\
        menu\\", name)\\n             a.horizontal_displacement = -3 * i\\n         \\
        \\    #a.resize(15,9)\\n             a.x = self.x - a.horizontal_displacement\\n\\
        \\             a.y = self.y    \\n             a.z = self.z + 1\\n          \\
        \\   self.objects.append(a)\\nelse:\\n   self.previous_collision = 0\\n     \\n\\
        # control displayed sprite (left / right / idle)\\n\\nif abs(self.vx) > 0.5:\\n\\
        \\    if self.vx > 0:\\n        self.sprite = \\"waiter_runright\\"\\n        self.displacement_object\\
        \\ = 7\\n    else:\\n        self.sprite = \\"waiter_runleft\\"\\n        self.displacement_object\\
        \\ = -7\\nelse:\\n    self.sprite = \\"waiter_idle\\"\\n    self.displacement_object\\
        \\ = 7\\n\\n# check if player bumps into a table\\n\\nfor surface in [\\"table1\\"\\
        ,\\"table2\\",\\"table3\\",\\"table4\\",\\"table5\\",\\"table6\\",\\"table7\\",\\"table8\\"\\
        ,\\"table9\\"]:\\n    if gamescreen.check_collisions(\\"player\\",surface):\\n \\
        \\       tb = gamescreen.gameobjects[surface]\\n        if self.y + self.vy\\
        \\ * 0.12 > tb.y - 35:\\n            if self.y + self.vy * 0.12 < tb.y  + tb.height\\
        \\ - 36:  \\n                if self.x + self.vx * 0.12 > tb.x - 20:\\n     \\
        \\               if self.x + self.vx * 0.12 < tb.x + 40:  \\n\\n            \\
        \\            # if this is reached, player collides with a table\\n\\n      \\
        \\                  # turn off motion in illegal direction\\n\\n            \\
        \\            if self.y <= tb.y - 35: \\n                           self.vy\\
        \\ = 0\\n                        if self.y >= tb.y:\\n                      \\
        \\     self.vy = 0\\n                        if self.x <= tb.x - 20:\\n     \\
        \\                      self.vx = 0\\n                        if self.x >= tb.x\\
        \\ + 40:\\n                           self.vx = 0\\n                        self.vy\\
        \\ = 0\\n                        self.vx = 0\\n\\n                        # lay\\
        \\ down things player needs to lay down (only if customer is at table)\\n\\n\\
        \\                        if tb.occupied > 0:\\n\\n                         \\
        \\  break_order = 0\\n\\n                           for i in range(0,len(self.objects)):\\n\\
        \\                              o = self.objects[i]\\n\\n                   \\
        \\           # lay down menu is player has it and occupant of table needs it\\n\\
        \\n                              if o.sprite == \\"menu\\":   \\n            \\
        \\                     if len(tb.occupants) > 0:\\n                        \\
        \\            for c in range(0,len(tb.occupants)):\\n                      \\
        \\                 cust = tb.occupants[c] \\n                              \\
        \\         if cust.workstate == \\"wscustomerwaitforwaiter\\" and cust.needs_menu\\
        \\ == 1:\\n\\n                                          cust.workstate = \\"wscustomerreadmenu\\"\\
        \\n                                          cust.has_menu = 1\\n          \\
        \\                                o.x = cust.x + 15\\n                     \\
        \\                     o.y = cust.y + 20\\n                                \\
        \\          o.z = cust.z + 20\\n                                          cust.objects.append(o)\\n\\
        \\                                          del self.objects[i]\\n         \\
        \\                                 print \\"now carrying \\", self.objects\\n\\
        \\                                          gamescreen.gameobjects[\\"statusline\\"\\
        ].new_message = \\"given menu to customer\\"\\n                             \\
        \\             break_order = 1\\n                                          break\\n\\
        \\n                              # lay down full dishes if ordered on that\\
        \\ table\\n\\n                              elif o.order[1] == \\"ordered\\" or\\
        \\ o.order[1] == \\"carrying\\":      \\n                                 print\\
        \\ \\"table number:\\",tb.number,\\"table number ordered:\\",o.order[2],\\"type:\\"\\
        ,o.order[0]\\n                                 if tb.number == o.order[2]:\\n\\
        \\                                    print \\"checking occupants:\\", tb.occupants\\n\\
        \\                                    print \\"order to deliver:\\",o.order[0],\\
        \\ o.order[1]\\n                                    break_order = 0\\n      \\
        \\                              customers_examined = 0\\n                  \\
        \\                  for c in range(0,len(tb.occupants)):\\n                \\
        \\                       cust = tb.occupants[c]\\n                         \\
        \\              print \\"customer\\",c,\\":\\",cust, \\"orders:\\"\\n            \\
        \\                           print cust.orders\\n                          \\
        \\             for on in range(0,len(cust.orders)):\\n                     \\
        \\                     if cust.orders[on][0] == o.order[0] and (cust.orders[on][1]\\
        \\ == \\"ordered\\" or cust.orders[on][1] == \\"carrying\\"):\\n               \\
        \\                              o.order[1] = \\"consuming\\"\\n              \\
        \\                               cust.orders[on] = o.order\\n              \\
        \\                               cust.workstate = \\"wscustomerconsume\\"\\n \\
        \\                                            cust.dly = cust.dly + game.menu_content[o.order[0]][6]\\
        \\ * (0.7 + random.random() * 0.6)  * game.frames_per_minute\\n            \\
        \\                                 o.x = cust.x + 15\\n                    \\
        \\                         o.y = cust.y + 20\\n                            \\
        \\                 o.z = cust.z + 20\\n                                    \\
        \\         cust.objects.append(o)\\n                                       \\
        \\      del self.objects[i]\\n                                             cust.has_drink\\
        \\ = 1\\n                                             print \\"customer orders:\\"\\
        \\n                                             print cust.orders\\n       \\
        \\                                      print \\"dish order:\\"\\n           \\
        \\                                  print o.order\\n                       \\
        \\                      gamescreen.gameobjects[\\"statusline\\"].new_message\\
        \\ = \\"order given to customer\\"\\n                                        \\
        \\     break_order = 1\\n                                             break\\n\\
        \\                                       \\n                               \\
        \\        if break_order == 1:\\n                                          break\\n\\
        \\n                                    # if break_order is 0, there is no-one\\
        \\ to give that order to, so it has to be discarded\\n                     \\
        \\               # prepare for discarding by setting the table number to -1\\n\\
        \\                                    if break_order == 0:\\n              \\
        \\                         o.order[2] = -1\\n                              \\
        \\         gamescreen.gameobjects[\\"statusline\\"].new_message = \\"Bring dish\\
        \\ back to cook\\"\\n                                 else:\\n               \\
        \\                     gamescreen.gameobjects[\\"statusline\\"].new_message =\\
        \\ \\"This order is for table \\" + str(o.order[2])\\n                       \\
        \\       if break_order == 1:\\n                                 break\\n\\n \\
        \\                          # take orders from customer if the table is occupied\\
        \\ with a customer group, the customer waits for the waiter, has orders\\n \\
        \\                          # and the player isn't carrying anything\\n\\n  \\
        \\                         for i in range(0,len(tb.occupants)):\\n         \\
        \\                     cust = tb.occupants[i]\\n                           \\
        \\   if cust.workstate == \\"wscustomerwaitforwaiter\\" and len(cust.orders)\\
        \\ > 0 and len(self.objects) == 0:\\n                                 cust.workstate\\
        \\ = \\"wscustomerorder\\"\\n                              elif cust.workstate\\
        \\ == \\"wscustomerwaitforwaiter\\" and cust.needs_menu == 1:\\n             \\
        \\                    gamescreen.gameobjects[\\"statusline\\"].new_message =\\
        \\ \\"Menu needed at table \\" + str(tb.number)\\n\\n                        #\\
        \\ pick up menu and empty dishes if on table\\n\\n                        open_orders\\
        \\ = 0\\n                        for cust in tb.occupants:\\n               \\
        \\            for ord in cust.orders:\\n                              if ord[1]\\
        \\ == \\"in_customer\\":\\n                                 open_orders = open_orders\\
        \\ + 1\\n\\n                        temp_count_objects = len(self.objects)\\n\\n\\
        \\                        # see if player has menues\\n\\n                  \\
        \\      self.has_menu = 0\\n\\n                        for i in self.objects:\\n\\
        \\                           if i.sprite == \\"menu\\":\\n                   \\
        \\           self.has_menu = 1\\n                              break\\n \\n  \\
        \\                      for i in range(0,len(tb.objects)):\\n              \\
        \\             print \\"Examining table object\\",i,\\":\\",tb.objects[i]\\n   \\
        \\                        if tb.objects[i].sprite == \\"menu\\":\\n          \\
        \\                    if open_orders == 0: \\n                             \\
        \\    print \\"taking menu off table\\"\\n                                 tb.objects[i].occupied\\
        \\ = 1\\n                                 tb.objects[i].x = self.x\\n       \\
        \\                          tb.objects[i].y = self.y    \\n                \\
        \\                 tb.objects[i].z = self.z + 1\\n                         \\
        \\        self.objects.append(tb.objects[i])\\n                            \\
        \\     self.has_menu = 1\\n                                 del tb.objects[i]\\n\\
        \\                                 tb.has_menu = 0\\n                      \\
        \\           print \\"finished taking menu off table\\"\\n                   \\
        \\              print \\"now carrying \\", self.objects\\n                   \\
        \\              break\\n                           else:\\n                 \\
        \\         \\n                              # check if the object is an empty\\
        \\ dish\\n\\n                              if tb.objects[i].state == 3 and (self.has_menu\\
        \\ == 0 or len(self.objects) == 0):\\n\\n                                 # check\\
        \\ if one of the customers has orders in other states than \\"owed\\", but only\\
        \\ is player is carrying nothing\\n\\n                                 unfilled_order\\
        \\ = 1\\n                                 if len(self.objects) == 0:\\n     \\
        \\                               unfilled_order = 0\\n                     \\
        \\               for c in range(0,len(tb.occupants)):\\n                   \\
        \\                    cust = tb.occupants[c]    \\n                        \\
        \\               for o in cust.orders:\\n                                  \\
        \\        if o[1] <> \\"owed\\":\\n                                          \\
        \\   unfilled_order = 1\\n                                             break\\n\\
        \\                                    if unfilled_order == 0:\\n\\n         \\
        \\                           # if no orders left, pay all consumed goods\\n\\
        \\  \\n                                       message = \\"Customer satisfaction:\\"\\
        \\n                                       for c in range(0,len(tb.occupants)):\\n\\
        \\                                          cust = tb.occupants[c]    \\n  \\
        \\                                        print \\"final contention:\\", cust.contention\\n\\
        \\                                          for o2 in range(0, len(cust.orders)):\\n\\
        \\                                             if cust.orders[o2][1] == \\"\\
        owed\\":\\n                                                game.score = game.score\\
        \\ + game.menu_content[cust.orders[o2][0]][1]\\n                           \\
        \\                     cust.orders[o2][1] = \\"paid\\"\\n                    \\
        \\                            if game.menu_content[cust.orders[o2][0]][3] ==\\
        \\ \\"drink\\":\\n                                                   game.tax_drinks\\
        \\ = game.tax_drinks + game.menu_content[cust.orders[o2][0]][1] / 6\\n     \\
        \\                                           else:\\n                      \\
        \\                             game.tax_dishes = game.tax_dishes + game.menu_content[cust.orders[o2][0]][1]\\
        \\ / 11\\n                         \\n                                      \\
        \\    cust.workstate = \\"wscustomerleave\\"                                \\
        \\    \\n                                          game.score = game.score +\\
        \\ int(cust.contention / game.frames_per_minute * 0.24) * 0.1\\n           \\
        \\                               satisfaction = cust.contention / game.frames_per_minute\\
        \\ / len(cust.orders) * 0.05\\n                                          message\\
        \\ = message + \\" \\" + str(int(satisfaction * 100)) + \\"%\\"\\n             \\
        \\                             game.customer_satisfaction = game.customer_satisfaction\\
        \\ * 0.999 + (satisfaction / 1000)\\n                                      \\
        \\    gamescreen.gameobjects[\\"statusline\\"].new_message = message\\n\\n    \\
        \\                                print \\"new overall customer satisfaction:\\"\\
        , game.customer_satisfaction\\n\\n                                 # remove\\
        \\ that object from the table (but take glasses only if customer has already\\
        \\ paid)\\n                                 \\n                             \\
        \\    if len(tb.occupants) == 0:\\n                                    unfilled_order\\
        \\ = 0\\n\\n                                 if unfilled_order == 0 or game.menu_content[tb.objects[i].order[0]][3]\\
        \\ == \\"meal\\":\\n                                    tb.objects[i].state =\\
        \\ 4\\n                                    tb.objects[i].x = self.x + 15\\n \\
        \\                                   tb.objects[i].y = self.y + 20\\n      \\
        \\                              tb.objects[i].z = self.z + 1\\n            \\
        \\                        tb.objects[i].horizontal_displacement = 0\\n     \\
        \\                               self.objects.append(tb.objects[i])\\n     \\
        \\                               del tb.objects[i]\\n                      \\
        \\              break\\n\\n                        # calm down any impatient\\
        \\ customers\\n\\n                        for i in range(0,len(tb.occupants)):\\n\\
        \\                           cust = tb.occupants[i]\\n                     \\
        \\      if cust.contention < 1000:\\n                              cust.contention\\
        \\ = cust.contention + 1000\\n                              if cust.number_in_group\\
        \\ == 0 or cust.number_in_group == 2 or cust.number_in_group == 4:\\n      \\
        \\                           self.sprite = \\"soldier_idle_wobp\\"\\n        \\
        \\                      else:\\n                                 self.sprite\\
        \\ = \\"soldier_idle_wobp_left\\"\\n                              # gamescreen.gameobjects[\\"\\
        statusline\\"].new_message = \\"calmed down customers on table\\"\\n\\n# check\\
        \\ for game screen borders\\n\\nif self.y > 400:\\n   self.vy = self.vy - 125\\n\\
        if self.y < 20:\\n   self.vy = self.vy + 125\\n\\n   # if at upper border, check\\
        \\ if player is with cook or at dish shelf\\n\\n   if gamescreen.check_collisions(\\"\\
        player\\",\\"cook\\"):\\n      gamescreen.gameobjects[\\"cook\\"].collision_player\\
        \\ = 1\\n   if self.x > 430 and self.x < 600:\\n      print \\"player is at dish\\
        \\ shelf\\"\\n\\n      # lay down any empty dishes the player may have and see\\
        \\ if player has menu\\n\\n      self.has_menu = 0\\n      self.number_full_dishes\\
        \\ = 0\\n      for i in range(0,len(self.objects)):\\n          o = self.objects[i]\\n\\
        \\n          # lay down object if it isn't a menu, but an empty dish\\n\\n  \\
        \\        if o.sprite <> \\"menu\\":                                        \\
        \\ \\n             if o.state == 4:\\n                o.state = -1\\n        \\
        \\        self.number_empty_dishes = 0\\n                o.x = self.x + 15\\n\\
        \\                o.y = self.y - 10\\n                o.z = self.z - 2\\n   \\
        \\             print \\"layed off\\", o.sprite\\n                gamescreen.gameobjects[\\"\\
        cook\\"].dirty_dishes.append(o)\\n                gamescreen.gameobjects[\\"\\
        cook\\"].sprite = \\"gb_cookworking\\"\\n                del self.objects[i]\\n\\
        \\                break\\n             else:\\n                self.number_full_dishes\\
        \\ = self.number_full_dishes + 1\\n          else:\\n             self.has_menu\\
        \\ = 1\\n\\n      # pick up full dishes, but only if player has no menu and no\\
        \\ more than 1 full dish\\n\\n      dish_obj = []\\n      last_table = -1\\n\\n\\
        \\      print \\"picking up full dishes...\\"\\n      if self.has_menu == 0: \\
        \\ \\n         if self.number_full_dishes < 3:\\n            if last_table >\\
        \\ -1:\\n               for dish in range(0,len(game.shelf)):\\n            \\
        \\         dish_obj = game.shelf[dish]\\n                     if dish_obj.order[2]\\
        \\ == last_table:\\n                        break\\n               else:\\n  \\
        \\                dish_obj = []\\n                  last_table = -1\\n      \\
        \\      print \\"picking up 2\\"\\n            if last_table == -1:\\n        \\
        \\       if len(game.shelf) > 0:\\n                  dish_obj = game.shelf[0]\\n\\
        \\                  dish = 0\\n\\n            print \\"picking up 3\\"\\n      \\
        \\      if dish_obj <> []:\\n               print \\"got object reference\\"\\n\\
        \\               if dish_obj.state == 0:\\n                  print \\"state =\\
        \\ 0\\"\\n                  dish_obj.state = 1\\n                  self.number_full_dishes\\
        \\ = self.number_full_dishes + 1\\n                  dish_obj.x = self.x + 15\\n\\
        \\                  dish_obj.y = self.y + 20\\n                  dish_obj.z\\
        \\ = self.z +1\\n                  dish_obj.horizontal_displacement = 0 \\n \\
        \\                 self.objects.append(dish_obj)\\n                  dish_obj.order[1]\\
        \\ = \\"carrying\\"\\n                  self.orders.append(dish_obj.order)\\n \\
        \\                 print \\"picked up dish\\"\\n                  gamescreen.gameobjects[\\"\\
        statusline\\"].new_message = \\"Picked up order for table \\" + str(dish_obj.order[2])\\n\\
        \\                  last_table = dish_obj.order[2]\\n                  del game.shelf[dish]\\n\\
        \\n      print \\"table collision completed\\"\\n\\n   # invoke menu\\n\\n   elif\\
        \\ self.x > 600:              \\n      self.workstate = \\"wsplayermenu\\"\\n\\n\\
        # check left/right border\\n\\nif self.x > 720:\\n   self.vx = self.vx - 125\\n\\
        \\n   # the right border is also the trashcan, so examine each carried dish\\
        \\ if it is still needed by a customer\\n   # and turn all unneeded objects\\
        \\ to empty dishes\\n\\n\\nif self.x < 10:\\n   self.vx = self.vx + 125\\n\\n# move\\
        \\ player and object he is carrying\\n\\nself.move_velocity()\\n\\nself.vy = self.vytemp\\n\\
        self.vx = self.vxtemp\\nself.z = self.y\\n\\nfor i in range(0,len(self.objects)):\\n\\
        \\   # print \\"moving object \\", i\\n   self.objects[i].x = self.x + 15 + self.displacement_object\\n\\
        \\   self.objects[i].y = self.y + 20 + self.objects[i].horizontal_displacement\\n\\
        \\   self.objects[i].z = self.z + 1\\n\\npass\\t", 5: "# draw all obstructions\\n\\
        \\nfor o in game.obstructions:\\n   gamescreen.gameobjects.add(\\"menusign\\"\\
        )\\n   \\n", 546: self.vy = -100, 548: self.vy = 100, 550: self.vx = 100, 552: self.vx
        = -100}
    inherits: null
    objtype: Workstate
  wsstatusline: !!python/object:game.WorkState
    actions: {1: 'self.color = (255,255,255)

        self.z = 1000

        self.clear()

        self.resize(400,20)

        self.new_message = ""

        self.colorcycle = 0

        self.forecolors = [[255,0,0],[0,128,0],[0,0,255],[255,0,255],[128,128,0],[0,128,128]]




        ', 3: "if self.new_message <> \\"\\":\\n   self.clear()\\n   self.draw_text(self.new_message,20,(self.forecolors[self.colorcycle][0],self.forecolors[self.colorcycle][1],self.forecolors[self.colorcycle][2]))\\n\\
        \\   self.new_message = \\"\\"\\n   self.colorcycle = self.colorcycle + 1\\n  \\
        \\ if self.colorcycle == 6:\\n      self.colorcycle = 0\\n"}
    inherits: null
    objtype: Workstate
  wstable: !!python/object:game.WorkState
    actions: {1: 'self.vx=0

        self.vy=0

        self.resize(48,37)

        self.occupied=0

        self.has_menu = 0

        self.objects = []

        self.occupants = []

        self.set_timer(1)

        ', 5: "print \\"table \\", self.number\\nprint \\"occupants: \\", self.occupants\\n\\
        print \\"Customer orders: \\"\\n\\nfor i in range(0,len(self.occupants)):\\n  \\
        \\ cust = self.occupants[i]\\n   print \\"customer \\", i, \\"orders:\\",cust.orders\\n",
      11: pass}
    inherits: null
    objtype: Workstate

"""
if __name__ == "__main__":
  import gbfileio,sys,runtime
  game = gbfileio.loadgame(sys.argv[0])
  runtime.run_game(game)
